java - hibernate Ant 工具

标签 java hibernate jakarta-ee ant

我已经使用 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/

相关文章:

java - 如何防止 java 应用程序中的帧注入(inject)(点击劫持)?

java - for 循环中缺少 return 语句

java - 类是托管的,但未在 persistence.xml 文件中列出

Java-EE : Cleaner and simpler alternatives to JSF

java - 涂黑谷歌地图 Activity 区域

java - HQL查询检查表是否有数据

java - 使用 ImprovedNamingStrategy 创建表时出错

java - 我应该升级 JBoss 还是完全避开它并迁移到 Tomcat?

mysql - 如何使用动态生成的链接更新数据库记录

Java 应用程序运行速度比应有的慢