WEB开发网
开发学院软件开发Java 动态表单及动态建表实现原理 阅读

动态表单及动态建表实现原理

 2009-09-22 00:00:00 来源:WEB开发网   
核心提示: hibernate.ftl<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEhibernate-mappingPUBLIC"-//Hibernate/HibernateMappingDTD

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>

上一页  1 2 3 4 5  下一页

Tags:动态 表单 动态

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接