File tree Expand file tree Collapse file tree
commerce-api/src/main/java/com/loopers/infrastructure/converter
commerce-batch/src/main/java/com/loopers/infrastructure/converter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .loopers .infrastructure .converter ;
2+
3+ import jakarta .persistence .AttributeConverter ;
4+ import jakarta .persistence .Converter ;
5+
6+ import java .time .YearMonth ;
7+
8+ @ Converter (autoApply = true )
9+ public class YearMonthAttributeConverter implements AttributeConverter <YearMonth , String > {
10+
11+ @ Override
12+ public String convertToDatabaseColumn (YearMonth attribute ) {
13+ return attribute != null ? attribute .toString () : null ;
14+ }
15+
16+ @ Override
17+ public YearMonth convertToEntityAttribute (String dbData ) {
18+ return dbData != null ? YearMonth .parse (dbData ) : null ;
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ package com .loopers .infrastructure .converter ;
2+
3+ import jakarta .persistence .AttributeConverter ;
4+ import jakarta .persistence .Converter ;
5+
6+ import java .time .YearMonth ;
7+
8+ @ Converter (autoApply = true )
9+ public class YearMonthAttributeConverter implements AttributeConverter <YearMonth , String > {
10+
11+ @ Override
12+ public String convertToDatabaseColumn (YearMonth attribute ) {
13+ return attribute != null ? attribute .toString () : null ; // "yyyy-MM"
14+ }
15+
16+ @ Override
17+ public YearMonth convertToEntityAttribute (String dbData ) {
18+ return dbData != null ? YearMonth .parse (dbData ) : null ;
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments