【发布时间】:2011-12-19 15:21:40
【问题描述】:
我使用 hibernate ant 工具生成带有注释的 hibernate pojo 类。 使用 ANT SCRIPT 从现有表生成 POJO 类的策略是什么?
我想出了答案,我正在发布它。
【问题讨论】:
标签: java hibernate jakarta-ee ant
我使用 hibernate ant 工具生成带有注释的 hibernate pojo 类。 使用 ANT SCRIPT 从现有表生成 POJO 类的策略是什么?
我想出了答案,我正在发布它。
【问题讨论】:
标签: java hibernate jakarta-ee ant
If table column is having not null constraint,
then a property related to that column in generated class will be of primitive type.
If table column is not having not null constraint,
then a property related to that column in generated class will be of java.lang.X type.
(X == any of Integer,Byte,Float,Double depends on table column type in database)
If table column is having primary key constraint,
then a property related to that column in generated class will be of primitive type.
If table column is having primary key constraint and it is AUTO INCREAMENT OR foreign key,
then a property related to that column in generated class will be of java.lang.X type.
(X == any of Integer,Byte,Float,Double depends on table column type in database)
【讨论】: