File tree Expand file tree Collapse file tree 3 files changed +9
-24
lines changed
main/java/org/mybatis/dynamic/sql
test/java/examples/simple Expand file tree Collapse file tree 3 files changed +9
-24
lines changed Original file line number Diff line number Diff line change 2525import org .mybatis .dynamic .sql .util .FragmentAndParameters ;
2626import org .mybatis .dynamic .sql .util .StringUtilities ;
2727
28- public class SqlColumn <T > implements BindableColumn <T >, SortSpecification , SqlColumnBuilders {
28+ public class SqlColumn <T > implements BindableColumn <T >, SortSpecification {
2929
3030 protected final String name ;
3131 protected final SqlTable table ;
@@ -146,29 +146,24 @@ public Optional<RenderingStrategy> renderingStrategy() {
146146 return Optional .ofNullable (renderingStrategy );
147147 }
148148
149- @ Override
150149 public <S > SqlColumn <S > withTypeHandler (String typeHandler ) {
151150 return cast (copyBuilder ().withTypeHandler (typeHandler ).build ());
152151 }
153152
154- @ Override
155153 public <S > SqlColumn <S > withRenderingStrategy (RenderingStrategy renderingStrategy ) {
156154 return cast (copyBuilder ().withRenderingStrategy (renderingStrategy ).build ());
157155 }
158156
159- @ Override
160157 @ SuppressWarnings ("unchecked" )
161158 public <S > SqlColumn <S > withParameterTypeConverter (ParameterTypeConverter <S , ?> parameterTypeConverter ) {
162159 return cast (copyBuilder ().withParameterTypeConverter ((ParameterTypeConverter <T , ?>) parameterTypeConverter ).build ());
163160 }
164161
165- @ Override
166162 @ SuppressWarnings ("unchecked" )
167163 public <S > SqlColumn <S > withJavaType (Class <S > javaType ) {
168164 return cast (copyBuilder ().withJavaType ((Class <T >) javaType ).build ());
169165 }
170166
171- @ Override
172167 public <S > SqlColumn <S > withJavaProperty (String javaProperty ) {
173168 return cast (copyBuilder ().withJavaProperty (javaProperty ).build ());
174169 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2323
2424public final class PersonDynamicSqlSupport {
2525 public static final Person person = new Person ();
26- public static final SqlColumn <Integer > id = person .id ;
26+ public static final PrimaryKeyColumn <Integer > id = person .id ;
2727 public static final SqlColumn <String > firstName = person .firstName ;
2828 public static final SqlColumn <LastName > lastName = person .lastName ;
2929 public static final SqlColumn <Date > birthDate = person .birthDate ;
@@ -32,7 +32,13 @@ public final class PersonDynamicSqlSupport {
3232 public static final SqlColumn <Integer > addressId = person .addressId ;
3333
3434 public static final class Person extends SqlTable {
35- public final SqlColumn <Integer > id = column ("id" , JDBCType .INTEGER ).withJavaProperty ("id" );
35+ public final PrimaryKeyColumn <Integer > id = new PrimaryKeyColumn .Builder <Integer >()
36+ .withTable (this )
37+ .withName ("id" )
38+ .withJdbcType (JDBCType .INTEGER )
39+ .withJavaProperty ("id" )
40+ .isPrimaryKeyColumn (true )
41+ .build ();
3642 public final SqlColumn <String > firstName = column ("first_name" , JDBCType .VARCHAR )
3743 .withJavaProperty ("firstName" );
3844 public final SqlColumn <LastName > lastName =
You can’t perform that action at this time.
0 commit comments