通过XDoclet(ant)生成Hibernate映射文件

通过XDoclet可以我们的精力放在编写java源文件上。

具体来说就是:
只有Java: java--->XDoclet(hibernatedoclet)--->Hbm---->SchemaExport(schemaexport,hbm2ddl)---->数据表

1:java源文件编写

420){this.resized=true;this.style.width=420;}" align=top> 420){this.resized=true;this.style.width=420;}" align=top> /**/ /*
420){this.resized=true;this.style.width=420;}" align=top> * Created on 2006-4-7
420){this.resized=true;this.style.width=420;}" align=top> 
*/

420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>
package  com.entity;
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>420){this.resized=true;this.style.width=420;}" align=top>
/** */ /**
420){this.resized=true;this.style.width=420;}" align=top> * 
@author  jkallen
420){this.resized=true;this.style.width=420;}" align=top> * @hibernate.class lazy="true" table="syn_dept"
420){this.resized=true;this.style.width=420;}" align=top> * @hibernate.cache usage="read-write"
420){this.resized=true;this.style.width=420;}" align=top> 
*/

420){this.resized=true;this.style.width=420;}" align=top> 420){this.resized=true;this.style.width=420;}" align=top>
public   class  SynDepartment  420){this.resized=true;this.style.width=420;}"> {
420){this.resized=true;this.style.width=420;}" align=top> 
420){this.resized=true;this.style.width=420;}" align=top>420){this.resized=true;this.style.width=420;}" align=top> 
/** */ /**  主键 id */
420){this.resized=true;this.style.width=420;}" align=top> 
private  Long id;
420){this.resized=true;this.style.width=420;}" align=top>420){this.resized=true;this.style.width=420;}" align=top> 
/** */ /**  部门名称 */
420){this.resized=true;this.style.width=420;}" align=top> 
private  String code_name;
420){this.resized=true;this.style.width=420;}" align=top> 
420){this.resized=true;this.style.width=420;}" align=top>420){this.resized=true;this.style.width=420;}" align=top> 
/** */ /**
420){this.resized=true;this.style.width=420;}" align=top>  * 
@return  Returns the id.
420){this.resized=true;this.style.width=420;}" align=top>  * @hibernate.id generator-class="native" column="id"
420){this.resized=true;this.style.width=420;}" align=top>  
*/

420){this.resized=true;this.style.width=420;}" align=top> 420){this.resized=true;this.style.width=420;}" align=top>    
public  Long getId()  420){this.resized=true;this.style.width=420;}"> {
420){this.resized=true;this.style.width=420;}" align=top>  
return  id;
420){this.resized=true;this.style.width=420;}" align=top> }

420){this.resized=true;this.style.width=420;}" align=top> 420){this.resized=true;this.style.width=420;}" align=top> 
public   void  setId(Long id)  420){this.resized=true;this.style.width=420;}"> {
420){this.resized=true;this.style.width=420;}" align=top>  
this .id  =  id;
420){this.resized=true;this.style.width=420;}" align=top> }

420){this.resized=true;this.style.width=420;}" align=top> 420){this.resized=true;this.style.width=420;}" align=top> 
/** */ /**
420){this.resized=true;this.style.width=420;}" align=top>    * 
@return  Returns the code_name.
420){this.resized=true;this.style.width=420;}" align=top>    * @hibernate.property column = "code_name"
420){this.resized=true;this.style.width=420;}" align=top>    
*/

420){this.resized=true;this.style.width=420;}" align=top> 420){this.resized=true;this.style.width=420;}" align=top> 
public  String getCode_name()  420){this.resized=true;this.style.width=420;}"> {
420){this.resized=true;this.style.width=420;}" align=top>  
return  code_name;
420){this.resized=true;this.style.width=420;}" align=top> }

420){this.resized=true;this.style.width=420;}" align=top> 420){this.resized=true;this.style.width=420;}" align=top> 
public   void  setCode_name(String code_name)  420){this.resized=true;this.style.width=420;}"> {
420){this.resized=true;this.style.width=420;}" align=top>  
this .code_name  =  code_name;
420){this.resized=true;this.style.width=420;}" align=top> }

420){this.resized=true;this.style.width=420;}" align=top>}

420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>



这里用到了几种@hibernate标记的用法
@hibernate.class标记指定类的映射代码,lazy="true" table="syn_dept"则如
hibernate的映射文件class元素的属性值具有相同的意义
@hibernate.id标记指定类的OID映射代码
@hibernate.property标记指定类的属性映射代码
另外还可能用到@hibernate.set(如一对多的情况下)

2:XDoclet--->Hbm(写在build.xml文件中,ANT运行)

420){this.resized=true;this.style.width=420;}" align=top> < target  name ="toHbm"  
420){this.resized=true;this.style.width=420;}" align=top>  depends
="compileEntity"  
420){this.resized=true;this.style.width=420;}" align=top>  description
="Generate hibernate mapping documents" >
420){this.resized=true;this.style.width=420;}" align=top>  
< hibernatedoclet  destdir ="${generated.dir}" >
420){this.resized=true;this.style.width=420;}" align=top>   
< fileset  dir ="${src.dir}" >
420){this.resized=true;this.style.width=420;}" align=top>    
< include  name ="**/entity/*.java"   />
420){this.resized=true;this.style.width=420;}" align=top>   
</ fileset >
420){this.resized=true;this.style.width=420;}" align=top>   
< hibernate  version ="2.0"   />
420){this.resized=true;this.style.width=420;}" align=top>  
</ hibernatedoclet >
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>  
< copy  todir ="${classes.dir}" >
420){this.resized=true;this.style.width=420;}" align=top>   
< fileset  dir ="${generated.dir}"   />
420){this.resized=true;this.style.width=420;}" align=top>  
</ copy >
420){this.resized=true;this.style.width=420;}" align=top> 
</ target >


通过hibernatedoclet就可以生成SynDepartment.hbm.xml映射文件
fileset顾名思义就是过滤文件了。
注:compileEntity--编译java源文件(自定义)

3:SchemaExport---->数据表

420){this.resized=true;this.style.width=420;}" align=top> < target  name ="toddl"  depends ="init" >
420){this.resized=true;this.style.width=420;}" align=top>  
< schemaexport  properties ="${classes.dir}/hibernate.properties"  
420){this.resized=true;this.style.width=420;}" align=top>   quiet
="no"  text ="no"  drop ="no"     
420){this.resized=true;this.style.width=420;}" align=top>   delimiter
="&#xd;&#xa;go&#xd;&#xa;"  output ="${sql.dir}/${synup.sql.file}"
420){this.resized=true;this.style.width=420;}" align=top>   
>
420){this.resized=true;this.style.width=420;}" align=top>   
< fileset  refid ="hibernate.synup.mapping.files"   />
420){this.resized=true;this.style.width=420;}" align=top>  
</ schemaexport >
420){this.resized=true;this.style.width=420;}" align=top>  
< echo  message ="Output sql to file: ${sql.dir}/${sql.file}"   />
420){this.resized=true;this.style.width=420;}" align=top> 
</ target >
420){this.resized=true;this.style.width=420;}" align=top> 
< fileset  id ="hibernate.synup.mapping.files"  dir ="${classes.dir}" >
420){this.resized=true;this.style.width=420;}" align=top>  
< include  name ="**/entity/*.hbm.xml"   />
420){this.resized=true;this.style.width=420;}" align=top> 
</ fileset >
通过schemaexport就向DB中生成table了。其中可能用到如下的一些属性:
 quiet:如果为yes,表示不把子DDL脚本输出到控制台
 drop:如果为yes,只执行删除数据库中的操作,但不创建新的表
 text:如果为yes,只会生成DDL脚本文件,但不会在数据库中执行DDL脚本
 output:指定存放DDL脚本文件的目录
 config:设定基于XML格式的配置文件, hbm2ddl(schemaexport)工具从这个文件中读取数据库的配置信息
 properties:设定基于java属性文件格式的配置文件,hbm2ddl(schemaexport)工具从这个文件中读取DB的配置信息
 format:设定DDL脚本中SQL语句的格式
 delimiter:为DDL脚本设置行结束符
 
 在ANT中执行:
 <target name="initOnlySynup" depends="toHbm,toddl">
 </target>
 
 OK,最后生成的映射文件如下:
420){this.resized=true;this.style.width=420;}" align=top> <? xml version="1.0" ?>
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>
<! DOCTYPE hibernate-mapping PUBLIC
420){this.resized=true;this.style.width=420;}" align=top>    "-//Hibernate/Hibernate Mapping DTD 2.0//EN" 
420){this.resized=true;this.style.width=420;}" align=top>    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"
>
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>
< hibernate-mapping >
420){this.resized=true;this.style.width=420;}" align=top>    
< class
420){this.resized=true;this.style.width=420;}" align=top>        
name ="com.SynDepartment"
420){this.resized=true;this.style.width=420;}" align=top>        table
="syn_dept"
420){this.resized=true;this.style.width=420;}" align=top>        dynamic-update
="false"
420){this.resized=true;this.style.width=420;}" align=top>        dynamic-insert
="false"
420){this.resized=true;this.style.width=420;}" align=top>    
>
420){this.resized=true;this.style.width=420;}" align=top>        
< cache  usage ="read-write"   />
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>        
< id
420){this.resized=true;this.style.width=420;}" align=top>            
name ="id"
420){this.resized=true;this.style.width=420;}" align=top>            column
="id"
420){this.resized=true;this.style.width=420;}" align=top>            type
="java.lang.Long"
420){this.resized=true;this.style.width=420;}" align=top>        
>
420){this.resized=true;this.style.width=420;}" align=top>            
< generator  class ="native" >
420){this.resized=true;this.style.width=420;}" align=top>            
</ generator >
420){this.resized=true;this.style.width=420;}" align=top>        
</ id >
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>        
< property
420){this.resized=true;this.style.width=420;}" align=top>            
name ="code_name"
420){this.resized=true;this.style.width=420;}" align=top>            type
="java.lang.String"
420){this.resized=true;this.style.width=420;}" align=top>            update
="true"
420){this.resized=true;this.style.width=420;}" align=top>            insert
="true"
420){this.resized=true;this.style.width=420;}" align=top>            access
="property"
420){this.resized=true;this.style.width=420;}" align=top>            column
="code_name"
420){this.resized=true;this.style.width=420;}" align=top>        
/>
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>        
<!--
420){this.resized=true;this.style.width=420;}" align=top>            To add non XDoclet property mappings, create a file named
420){this.resized=true;this.style.width=420;}" align=top>                hibernate-properties-SynDepartment.xml
420){this.resized=true;this.style.width=420;}" align=top>            containing the additional properties and place it in your merge dir.
420){this.resized=true;this.style.width=420;}" align=top>        
-->
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>    
</ class >
420){this.resized=true;this.style.width=420;}" align=top>
420){this.resized=true;this.style.width=420;}" align=top>
</ hibernate-mapping >
420){this.resized=true;this.style.width=420;}" align=top>


 控制台中部分信息如下:

420){this.resized=true;this.style.width=420;}" align=top> [schemaexport] drop table syn_dept cascade constraints
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] go
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] drop sequence hibernate_sequence
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] go
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] create table syn_dept (
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] id number(19,0) not null,
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] code_name varchar2(255),
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] primary key (id)
420){this.resized=true;this.style.width=420;}" align=top>[schemaexport] )

DB中已经生成syn_dept表了,快去看下吧!

关于Xdoclet 中的hibernate标签更多信息可以参考:
http://xdoclet.sourceforge.net/xdoclet/tags/hibernate-tags.html#@hibernate_collection-key__0__1_
我还在一个网友的博客上看到了他对此的汉化:
http://blog.youkuaiyun.com/fasttalk/archive/2005/09/19/484615.aspx


参考资料:Hibernate持久化技术详解

来源:http://www.blogjava.net/Jkallen/archive/2006/04/10/40305.html

【AN7581】AN7581 SDK编译环境搭建操作说明 安装编译需要的工具包。 阅读详情

相关推荐

基因家族快速鉴定指南:Windows平台下的HMMER实战解析

本文详细解析了在Windows平台下使用HMMER工具进行基因家族快速鉴定的完整实战流程。通过手把手指导,从软件获取、数据准备到模型构建与序列搜索,帮助生物信息学新手无需Linux环境,即可高效完成bZIP转录因子等家族的鉴定工作,大幅降低分析门槛。

weixin_29255731的博客 460

Ant + XDoclet2生成Hibernate3的配置及映射文件

<br />第一步:Ant的使用<br /> 先简单介绍一下吧,解压后,将解压目录设置到环境变量ANT_HOME(确保JAVA_HOME有效),然后在path中添加%ANT_HOME%/bin,这时在cmd中运行ant命令,如果不提示ant为无效命令,就说明Ant已经可以正常使用了!这个时候就可以写一个build.xml文件(参见ant的帮助文档),然后进入cmd,转至build.xml文件所在目录,直接运行ant命令就可以完成build.xml中定义的Task了。<br /> <br />第二步:<

周嘉笙的博客 1151

速腾Helios-16P使用Lego-loam实时构建点云地图(二)——Lego-loam的编译与运行

不兼容的问题,打开lego-loam的~/lego-loam_ws/src/LeGO-LOAM/LeGO-LOAM/src下的4个源码文件,搜索/camera_init,将所有/camera_init改成camera_init,也就是去掉斜杠,这样再回到工作空间重新编译lego-loam。3、速腾16线激光雷达RS-16 ----- 3D建图算法LeGO-LOAM的使用(Ubuntu18.04 + ROS Melodic)_速腾16线 lego loam_杰尼君的博客-优快云博客。

qq_59475883的博客 2568

通过Ant+Xdoclet生成Hibernate配置文件和映射文件

在上篇文章中,我们介绍了Ant的基本概念及其简单的使用方法,在文章的最后有一个例子用到了Xdoclet相关内容,本篇文章主要来介绍Xdoclet以及通过Ant+Xdoclet生成Hibernate配置文件和映射文件. Xdoclet基本概念    我们可以在java代码中使用类似于javadoc的注释,来表达更多的内容。这些额外的注释,通过使用xdoclet工具,我们可以将它们转换为我们需要的

潛龍,勿用 1987

Cursor插件安装CodeX保姆级教程:从登录到调整面板布局,一步不落

本文提供Cursor编辑器安装CodeX插件的详细教程,涵盖从登录到调整面板布局的全流程。通过优化界面布局和配置参数,帮助开发者提升编码效率,特别适合需要智能代码补全的编程场景。

weixin_42648844的博客 4762

《揭秘 BME688人工智能压力湿度温度气体传感器:气体检测的多面能手》:此文为AI自动生成

BME688 是博世推出的一款具有人工智能和集成高线性度高精度压力、湿度、温度传感器的气体传感器,专为移动和联网应用开发,尺寸紧凑且低功耗。BME688 作为一款先进的传感器,在多个领域展现出卓越的性能。它采用了坚固而紧凑的 3.0 x 3.0 x 0.9 mm³ 封装,这种小巧的尺寸使其能够轻松应用于对空间要求严格的移动设备和联网应用中。同时,低功耗的特性也使得它在能源有限的环境下能够长时间稳定运行。

zheng_ruiguo的专栏 1931

利用ant和XDOCLET生成Hibernate3配置文件和映射文件的BUILD.XML

/xdoclet-1.2.3" />                    <taskdef name="hibernatedoclet" classname="xdoclet.modules.hibernate.HibernateDocletTask" cl

chenzenan的专栏 788

chromium通信系统-ipcz系统(二)-ipcz系统代码实现-同Node通信

在chromium通信系统-mojo系统(一)-ipcz系统基本概念一文中我们介绍了ipcz的基本概念。 本章我们来通过代码分析它的实现。 handle系统 为了不对上层api暴露太多细节,实现解耦,也方便于传输,ipcz系统使用handle表示一个对象,handle类似于文件描述符,用IpczHandle类型表示ipcz系统内的一个对象。一个可以用IpczHandle 句柄表示的对象必须是APIObject子类。APIObject数据结构如下 class APIObject : public RefCou

woai110120130的专栏 1775

ant深入浅出(一)ant+xdoclet 生成hibernate配置文件以及实体映射文件

前言 作为一个学习生物学的人,应该知道它是蚂蚁的意思,蚂蚁(ant)属节肢动物门,昆虫纲,膜翅目,蚁科。在众多的科中有的还分了亚科,用来区分更多的种类, 蚂蚁是地球上最常见的昆虫,数量最多的昆虫种类。由于各种蚂蚁都是社会性生活的群体,在古代通称“蚁”。据现代形态科学分类,蚁可分两大种群:蚂蚁类和白蚁类。 蚁族的特征是体积小、数量多,往往是成群结队的出行,在软件领域之所以用...

369540808 115

【图像去噪】基础知识之加噪 | 给图像加噪的若干种方式,包括加高斯白噪声(AWGN)、泊松-高斯噪声、模拟真实噪声(SIDD、DND)等

本文介绍给干净图像加噪的若干种方式,新手入门必看!。根据noise类型不同,产生不同的Noisy,Noisy一般是模型输入。【图像去噪】基础知识之图像流 | 图像从输入到输出的前世今生,包括类型变化、维度变化、数值变化等。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 1099

YOLO26涨点改进 | 全网独家复现、小目标检测改进篇 | TGRS 2025 | YOLO26引入MFAE-YOLO中的GFFP、FCPS 和 C3k2-FPEU创新点,涨点起飞,直接发论文

🔥本文给大家介绍在YOLO26中引入MFAE-YOLO中的 GFFP(全局特征融合处理)、FCPS(特征通道像素注意力) 和 C3k2-FPEU(特征池提取单元) 二次创新改进模块,能显著提升对小目标的检测性能。GFFP通过多尺度特征融合增强全局上下文感知能力,有效提升小目标在复杂背景下的可辨性;FCPS融合通道、像素和空间注意力机制,增强了模型对关键细节和小区域特征的关注,提升检测精度;C2F-FPEU利用多种池化方式挖掘细节特征,优化浅层特征表示能力。三者协同提升了YOLO26在小目标检测中的鲁棒性。

Ai缝合怪、助力小伙伴高效发论文 306

XDoclet配合Ant生成Hibernate文件

使用概念理念

李达 1801

具身大小脑全栈全网独家复现|LLM链式推理+边缘VLA感知+毫秒级运动小脑、优化人形步态僵硬运动滞后、打通思考-行走-操作全链路适配居家工业多场景落地

高层决策大脑(异步10Hz,GPU算力):轻量化机器人微调LLM+RhinoVLA边缘视觉大模型,负责自然语言链式工序拆解、全局环境语义感知、目标物体筛选、跨机器人动作适配,输出粗粒度运动目标,不介入底层伺服计算;依托View Registry实现异构机器人动作对齐,适配多形态机器人切换;中层调度小脑(硬实时1kHz,CPU算力)

qq_36130719的博客 257

Ant+XDoclet

Ant是一个构建工具,它可以帮助我们将项目开发过程中需要完成的各种步骤组织起来,通过一个简易的方式来构建整个项目。Ant究竟能做什么呢?这取决于Ant的任务(Task),Ant有哪些任务,就能完成哪些工作!一些典型的任务是:编译java源代码、运行java程序、拷贝文件或目录、将编译完成的类打包等等。 当然,Ant是一个开放的架构,任何人,都可以按照自己的方式,添加自己的任务(Task),这需要遵

李颖杰--廊坊师范学院七期信息技术提高班 1230

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Xdoclet + Ant自动生成Hibernate配置文件

在使用Hibernate的时候,过多的Hibernate配置文件是一个让人头疼的问题。最近接触了Xdoclet这个工具。它实际上就是一个自动代码生成的工具,Xdoclet不能单独运行,必须搭配其他工具一起使用,比如ant。如果ant的工具不会用,建议先补充一下ant的基本知识在来学习Xdoclet。       Ant是什么?        Apache Ant 是一个基于

SERLIN 642

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

使用XDoclet反向生成hibernate映射文件和DDL

1 在编写vo文件时候在类和字段的注释上添加xdoclet使用的信息 import java.util.Calendar; import java.util.Set; import java.io.Serializable; /** * @author Chenhui * @hibernate.class table="TB_User" */ public class Use...

hchen229的专栏 153

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Ant+xdoclet

      使用Ant+xdoclet结合,可以很快的生成hibernate的映射文件。       要使用xdoclet必须导入xdoclet的jar包。具体的jar包可以到apache的官方网站下载,地址为: http://xdoclet.sourceforge.net/xdoclet/install.html。下载的时候注意下载xdoclet-bin-1.2,因为它包含了jar包、例子程...

littie1987的专栏 190

利用Ant和Xdoclet从pojo类生成hibernate的映射文件并生成hibernate的配置文件

ant配置步骤:1、首先先解压ant的压缩包;2、配置环境变量,先确保有JAVA_HOME变量并且正确3、用户中添加ANT_HOME变量 ANT_HOME=D:/OATools/apache-ant-1.6.54、添加path=%ANT_HOME%/bin(cmd窗口测 输入ant 出现Buildfile: build.xml does not exist!Build failed表示配置成功)5、在项目根目录中添加build.xml文件里面配置正确的信息

学炸窝的虫子 1155

[Hibernate]使用XDoclet生成hbm.xml

Hibernate真是受欢迎,有那么多工具为它服务,XDoclet、MiddleGen、各种插件。。。 用XDoclet生成hbm.xml就是在.java文件里写入一些元数据,XDoclet会从这些数据以及类本身得到足够的信息来生成目标文件。当然,除了用于hibernate,XDoclet还可以用于web、ejb等等很多用途。 XDoclet要从sourceforge上下载,包含了很...

diaozhuo4700的博客 153

使用XDoclet生成hbm.xml

 使用XDoclet生成hbm.xml- -                              Google一下网上用XDoclet生成Hibernate Mapping和建表的文章很多,我以前都是先把表建好,然后手工写Mapping文件,这样很费时间,用XDoclet后在建模过程中在POJO类中加入XDoclet标签,这样节省了很多时间。用

kxtk的专栏 2873

Ant+Xdoclet入门实例

Ant是一个构建工具,自Maven出现以前,一直占据着很大的市场,目前来看Maven占据着上峰,因此推荐大家尝试使用Maven,我在上篇中简单的写了些关于Maven的搭建:《搭建Maven开发环境》,供参考。 关于Ant的文章很多,就不多做介绍,下面比较下Ant和Maven的异同点: 1.   定位:Ant是构建工具;Maven是软件项目管理和理解工具,Maven基本具备Ant的功能。

袁伏彪 —— 共享,共赢 2288

XDoclet 与Hibernate 映射

       在POJO 中融合XDoclet 的映射文件自动生成机制,提供了除手动编码和由数据库导出基础代码的第三种选择。      XDoclet已经广泛运用在EJB开发中,在其最新版本里,包含了一个为Hibernate提供支持的子类库Hibernate Doclet,其中包含了生成Hibernate映射文件所需的ant构建支持以及java doc tag支持。     XDoclet实现基本...

nemy 149

xdoclet的使用

Xdoclet基本概念我们可以在java代码中使用类似于javadoc的注释,来表达更多的内容。这些额外的注释,通过使用xdoclet工具,我们可以将它们转换为我们需要的各种配置文件。先看一个简单的例子:比如有一个java文件的源代码如下:/** * @hibernate.class *          table="T_Party" */public

datouuupp的专栏 550
上一篇: 利用Hibernate配置文件生成数据库
下一篇: 应用Hibernate3的DetachedCriteria实现分页查询
lhycarter
博客等级 码龄14年 0粉丝 2原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值