hibernate基本映射文件
生活随笔
收集整理的這篇文章主要介紹了
hibernate基本映射文件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"><hibernate-mapping package="com.fengye.hibernate"><!--class: 表示 實體類和表的映射 與數據庫的相關設置不能出現數據庫中的關鍵字dynamic-update:更新的sql語句不包含空值.動態組織sql語句dynamic-insert:插入式時不包含空的屬性列,用于動態組織sql語句select-before-update:在更新時先查詢--><class name="com.fengye.hibernate.basic.BasicMap" table="BASIC_MAP"dynamic-update="true"dynamic-insert="true"select-before-update="true"><id name="id" type="java.lang.Integer"><column name="ID"/><!-- 指定主鍵的生成方式, native: 使用數據庫本地方式 --><generator class="native"/><!-- hilo --><!--<generator class="hilo"><param name="table">HI_TABLE</param><param name="column">NEXT_VAL</param><param name="max_lo">10</param></generator>--></id><!-- 普通屬性 - property --><property name="title"type="java.lang.String" column="TITLE"></property><property name="author" type="java.lang.String"index="news_index"><column name="AUTHOR"/></property><!-- 時間(年/月/日,具體時間)--><property name="date" type="date"/><property name="time" type="time"/><property name="timestamp" type="timestamp"/><!-- boolean --><property name="isUsed" type="yes_no"><column name="isUsed" sql-type="varchar(1)"></column></property><!-- enum --><property name="gender"><column name="gender"></column><type name="org.hibernate.type.EnumType"><param name="enumClass">com.fengye.hibernate.basic.Gender</param><param name="type">12</param></type></property><property name="desc" formula="(SELECT concat(author, ': ', title) FROM BASIC_MAP n WHERE n.id = id)"/><!-- 大文本--><property name="content"><column name="content" sql-type="mediumtext"/></property><property name="image"><column name="IMAGE" sql-type="mediumblob"></column></property><!-- component--><component name="component" class="com.fengye.hibernate.basic.Component"><parent name="map"/><property name="component1" column="component1"/><property name="component2" column="component2"/></component></class></hibernate-mapping>
?
轉載于:https://www.cnblogs.com/fengyexjtu/p/5123074.html
總結
以上是生活随笔為你收集整理的hibernate基本映射文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 全栈工程师?并没有什么卵用。每个人都应该
- 下一篇: 开源项目_可能使用到的开源项目集合