I tried setting this at this class level, but get the following message:
Code:
[java] 10:24:10,145 ERROR HibernateDAOFactory:38 - net.sf.hibernate.MappingException: optimistic-lock attribute not supported for joined-subclass mappings: aero.timco.approval.document.Document
Here's the entire mapping file (note, with optimistic-lock="none" still there...
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="aero.timco.approval.document.Document" table="document" optimistic-lock="none">
<meta attribute="implements">
aero.timco.approval.Identifiable
</meta>
<meta attribute="class-code">
public Long getId() {
return getDid();
}
public void setId(Long id) {
setDid(id);
}
public int getNumberApprovals() {
return approvals.size();
}
public int getNumberAccepted() {
int accepted = 0;
java.util.Iterator it = approvals.iterator();
while(it.hasNext()) {
if(((Approval)it.next()).getApproved() == 1) {
accepted++;
}
}
return accepted;
}
public int getNumberRejected() {
int rejected = 0;
java.util.Iterator it = approvals.iterator();
while(it.hasNext()) {
if(((Approval)it.next()).getApproved() == 2) {
rejected++;
}
}
return rejected;
}
public int getNumberPending() {
int pending = 0;
java.util.Iterator it = approvals.iterator();
while(it.hasNext()) {
if(((Approval)it.next()).getApproved() == 0) {
pending++;
}
}
return pending;
}
</meta>
<meta attribute="class-code">static final long serialVersionUID = 0L;</meta>
<id name="did" column="did" type="long">
<generator class="native"/>
</id>
<timestamp column="last_updated" name="lastUpdated"/>
<property name="name" column="name" type="string" length="50" not-null="true"/>
<property name="description" column="description" type="text"/>
<property name="createTime" column="create_time" type="timestamp" not-null="true"/>
<property name="dueTime" column="due_time" type="timestamp"/>
<!--<property name="lastUpdated" column="last_updated" type="timestamp"/>
--><property name="submitted" column="submitted" type="boolean" not-null="true"/>
<property name="stopOnRejection" column="stop_on_rejection" type="boolean" not-null="true"/>
<many-to-one name="author" class="aero.timco.approval.document.User" cascade="none">
<meta attribute="finder-method">findByAuthorID</meta>
<column name="author_id" not-null="true"/>
</many-to-one>
<many-to-one name="documentType" class="aero.timco.approval.document.DocumentType" cascade="none">
<column name="document_type_id" not-null="true"/>
</many-to-one>
<!-- set lazy to true when done testing and put accessors to notes in dao -->
<set name="notes" lazy="false" inverse="true" cascade="all">
<key column="document_id"/>
<one-to-many class="aero.timco.approval.document.Note"/>
</set>
<!-- set lazy to true when done testing and put accessors to attachments in dao -->
<set name="attachments" lazy="false" inverse="true" cascade="all">
<key column="document_id"/>
<one-to-many class="aero.timco.approval.document.Attachment"/>
</set>
<!-- set lazy to true when done testing and put accessors to attachments in dao -->
<set name="approvals" lazy="false" inverse="true" cascade="all">
<meta attribute="scope-field">protected</meta>
<key column="document_id"/>
<one-to-many class="aero.timco.approval.document.Approval"/>
</set>
<joined-subclass name="aero.timco.approval.document.CapexDocument" table="capex_document">
<key column="capex_id"/>
<property name="npv" column="npv" type="big_decimal"/>
</joined-subclass>
</class>
</hibernate-mapping>
<!--
signoffs
-->