休眠蚂蚁工具 [英] Hibernate Ant Tools

查看:27
本文介绍了休眠蚂蚁工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have used hibernate ant tool to generate hibernate pojo classes with annotations. What is the POJO class generation strategy from existing tables using ANT SCRIPT?

我找到了答案并发布了.

I figured out the answer and I'm posting it.

推荐答案

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)

这篇关于休眠蚂蚁工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆