我已经使用 hibernate ant 工具生成带有注释的 hibernate pojo 类。 使用 ANT SCRIPT 从现有表生成 POJO 类的策略是什么?
我找到了答案并发布了它。
最佳答案
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)
关于java - hibernate Ant 工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8563437/