gpt4 book ai didi

java - hibernate Ant 工具

转载 作者:行者123 更新时间:2023-11-29 06:05:46 26 4
gpt4 key购买 nike

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com