I have a class mapping in which I would like to have a particular value populated in the database for this type of class; however, I do not need this property mapped to the class(i.e. no getter or setter). In my example below what I am trying to achieve is have the DOCUMENT_TYPE column populated with "GLOBAL" on the initial insert of this type of object. It currently does not work because hibernate complains that it could not find a getter for "docType" property. Is there a way to define a property but not have it mapped to a property in the class?
Code:
<class name="GlobalDocument" table="DOCUMENTS">
<id name="id" column="DOC_ID">
<generator class="native"/>
</id>
<snipped>
<property name="docType" update="false">
<column name="DOCUMENT_TYPE" default="GLOBAL"/>
</property>
</class>
Thanks