@Target(value=FIELD) @Retention(value=RUNTIME) public @interface Column
Where will detect this annotation:
Object oriented way: Suid,SuidRich,MoreTable will detect.
The create SQL command (Ddl.java) generated according to the Javabean will detect.
Where will not detect this annotation:
Entities in PreparedSql are used as return types, and column annotations are not detected for entities.
Mapsuid will not detect
JustFetch annotated fields should not be annotated with Column.
Notice: the mapping implementation needs to be developed by the user(implement the ColumnHandler interface,
and use NameTranslateHandle.setColumnHandler(columnHandler) to set).
The use of Column annotation is not officially recommended base the bellow reason.
Benefits of not using Column annotation:
Convention-over-configuration, automatic naming mapping can be used, and the rules are simple.
You can use the Bee framework to automatically generate the Javabean corresponding to the table.
The table structure is changed and easy to maintain. It can be automatically generated again.
Keep appropriate redundancy. Fields such as creation time and creator do not need to be moved to the parent class,
the table can correspond to the Javabean without too much manual intervention. It can save more time to focus on business logic.
The processing speed is faster.
Solution:
1)Suid,SuidRich,MoreTable will parse entity to sql automatically;
2)Moretable can also handle the situation that different tables have duplicate name fields and different DB paging syntax.
3)Custom SQL, alias with "as"(select column_name as java_field_name),
The query results can be automatically parsed to the given Javabean structure.
4)Ignore field can use @Ignore
5)Using JustFetch annotation
@ JustFetch("CONCAT(fisrt_name,last_name)")
private String fullname;
-->select CONCAT(fisrt_name,last_name) as fullname
@ JustFetch("name")
private String name2;
-->select name as name2
@Deprecated public abstract String value
Copyright © 2022. All rights reserved.