1. 程式人生 > >hibernate對映只讀屬性(多次對映)

hibernate對映只讀屬性(多次對映)

需在對映檔案中將insert="false" update="false",這樣,該欄位可被對映為多個

        <discriminator column="obj_type"/>
       
    <property insert="false" update="false" name="objType" type="java.lang.String">
     <column name="obj_type">
        <comment>資料型別(assets,consumables,workflow,contract)</comment>
     </column>
    </property>