-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Lesson_05 DataProvider implementation #165
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...pes_app/src/main/java/com/codedifferently/lesson5/dataprovider/AaronSantiagoProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.codedifferently.lesson5.dataprovider; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.Map; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class AaronSantiagoProvider extends DataProvider { | ||
public String getProviderName() { | ||
return "aaronsantiago"; | ||
} | ||
|
||
public Map<String, Class> getColumnTypeByName() { | ||
return Map.of( | ||
"column1", Long.class, | ||
"column2", BigDecimal.class, | ||
"column3", Integer.class, | ||
"column4", Double.class, | ||
"column5", Boolean.class, | ||
"column6", String.class, | ||
"column7", Float.class); | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
lesson_05/types/types_app/src/main/resources/data/aaronsantiago.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
[ | ||
{ | ||
"column1": "8021617119863445504", | ||
"column2": "12876", | ||
"column3": "1507084994", | ||
"column4": "4.960121985830803E307", | ||
"column5": "false", | ||
"column6": "hizxe4u3", | ||
"column7": "2.7161422E38" | ||
}, | ||
{ | ||
"column1": "2784514035727543296", | ||
"column2": "13984", | ||
"column3": "121436784", | ||
"column4": "1.0481932880019241E308", | ||
"column5": "false", | ||
"column6": "m2qogb9168", | ||
"column7": "1.1755943E38" | ||
}, | ||
{ | ||
"column1": "8540468770226965504", | ||
"column2": "5047", | ||
"column3": "1088543043", | ||
"column4": "1.0410346658580802E308", | ||
"column5": "false", | ||
"column6": "s1oulfwn8", | ||
"column7": "2.7863149E38" | ||
}, | ||
{ | ||
"column1": "8814347693214015488", | ||
"column2": "7854", | ||
"column3": "980684217", | ||
"column4": "4.1357845071862433E307", | ||
"column5": "false", | ||
"column6": "f4z8sy", | ||
"column7": "8.3855787E37" | ||
}, | ||
{ | ||
"column1": "4512523429958404096", | ||
"column2": "14872", | ||
"column3": "881941291", | ||
"column4": "1.4277797319059275E308", | ||
"column5": "true", | ||
"column6": "tcb7ji", | ||
"column7": "2.8878202E38" | ||
}, | ||
{ | ||
"column1": "1498144379577860608", | ||
"column2": "23359", | ||
"column3": "1201087203", | ||
"column4": "1.411667594380979E308", | ||
"column5": "true", | ||
"column6": "174r60fa53n", | ||
"column7": "8.2908685E37" | ||
}, | ||
{ | ||
"column1": "7379905184042490880", | ||
"column2": "28235", | ||
"column3": "1979568008", | ||
"column4": "8.440394641368463E307", | ||
"column5": "false", | ||
"column6": "re9j354x", | ||
"column7": "2.6941474E38" | ||
}, | ||
{ | ||
"column1": "3535766253948793856", | ||
"column2": "30768", | ||
"column3": "591616124", | ||
"column4": "1.03740846022905E308", | ||
"column5": "false", | ||
"column6": "i4ja6nhy2lqv", | ||
"column7": "2.5594035E37" | ||
}, | ||
{ | ||
"column1": "516571131347934528", | ||
"column2": "26694", | ||
"column3": "912557766", | ||
"column4": "3.7253732575389864E307", | ||
"column5": "true", | ||
"column6": "qxth71ra3j5c", | ||
"column7": "8.751905E37" | ||
}, | ||
{ | ||
"column1": "9167923257838168064", | ||
"column2": "18468", | ||
"column3": "1675332497", | ||
"column4": "1.3818560330114934E308", | ||
"column5": "false", | ||
"column6": "8xbaltqk61zd", | ||
"column7": "9.151857E37" | ||
} | ||
] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the instructions, you were directed to use the "closest possible data type." There is a different data types that would be more efficient to store the data in column2 based on its size.