动态表单及动态建表实现原理
2009-09-22 00:00:00 来源:WEB开发网hibernate.ftl
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class
name="${entity.name}"
table="`${entity.tableName}`"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version">
<id
name="id"
column="id"
type="java.lang.String"
unsaved-value="null">
<generator class="uuid" />
</id>
<#if entity.formAttributeList?exists>
<#list entity.formAttributeList as attr>
<#if attr.name == "id">
<#else>
<property
name="${attr.name}"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="`${attr.columnName}`"
length="${attr.length}"
not-null="false"
unique="false"
/>
</#if>
</#list>
</#if>
</class>
</hibernate-mapping>
更多精彩
赞助商链接