【问题标题】:Hibernate Ant Tools休眠蚂蚁工具
【发布时间】:2011-12-19 15:21:40
【问题描述】:

我使用 hibernate ant 工具生成带有注释的 hibernate pojo 类。 使用 ANT SCRIPT 从现有表生成 POJO 类的策略是什么?

我想出了答案,我正在发布它。

【问题讨论】:

    标签: java hibernate jakarta-ee ant


    【解决方案1】:
    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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-22
      • 2011-09-12
      • 1970-01-01
      • 1970-01-01
      • 2012-10-09
      • 2010-09-29
      • 1970-01-01
      相关资源
      最近更新 更多