-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36948a7
commit 50483bf
Showing
10 changed files
with
92 additions
and
84 deletions.
There are no files selected for viewing
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
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
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,37 @@ | ||
package com.example.newyorkbabies.model; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Table(name = "baby_info") | ||
public class Baby { | ||
@Id | ||
|
||
@Column(name = "YEAR_OF_BIRTH") | ||
private int yearOfBirth; | ||
|
||
@Column(name = "GENDER") | ||
private String gender; | ||
|
||
@Column(name = "ETHNICITY") | ||
private String ethnicity; | ||
|
||
@Column(name = "FIRST_NAME") | ||
private String firstName; | ||
|
||
@Column(name = "COUNT") | ||
private Integer count; | ||
|
||
@Column(name = "SCORE") | ||
private Integer score; | ||
} | ||
|
20 changes: 0 additions & 20 deletions
20
src/main/java/com/example/newyorkbabies/model/BabyDto.java
This file was deleted.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
src/main/java/com/example/newyorkbabies/processor/CSVItemProcessor.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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package com.example.newyorkbabies.processor; | ||
|
||
import com.example.newyorkbabies.model.BabyDto; | ||
import com.example.newyorkbabies.model.Baby; | ||
import org.springframework.batch.item.ItemProcessor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class CSVItemProcessor implements ItemProcessor<BabyDto, BabyDto> { | ||
public class CSVItemProcessor implements ItemProcessor<Baby, Baby> { | ||
|
||
@Override | ||
public BabyDto process(BabyDto record) throws Exception { | ||
System.out.println("BabyRecord: " + record.getFirstName()); | ||
return null; | ||
public Baby process(Baby record) throws Exception { | ||
System.out.println("BabyRecord: " + record.toString()); | ||
return record; | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
src/main/java/com/example/newyorkbabies/reader/CSVItemReader.java
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/main/java/com/example/newyorkbabies/repository/BabyRepository.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.example.newyorkbabies.repository; | ||
|
||
import com.example.newyorkbabies.model.BabyDto; | ||
import com.example.newyorkbabies.model.Baby; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface BabyRepository extends JpaRepository<BabyDto,Long> { } | ||
public interface BabyRepository extends JpaRepository<Baby,Long> { } |
14 changes: 0 additions & 14 deletions
14
src/main/java/com/example/newyorkbabies/writer/CSVItemWriter.java
This file was deleted.
Oops, something went wrong.
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
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