-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: problem with hibernate update control
PostPosted: Fri Sep 24, 2004 4:03 pm 
Newbie

Joined: Fri Sep 24, 2004 3:35 pm
Posts: 1
I am using hibernate to connect to an oracle 8i database.
I have a class called joborder(see below) which extends a class we call modification tracker.
Modification tracker creates the PropertyChangeSupport, so that table triggers are not fired to update audit tables if the data has not changed.
The problem is the joborder class contains collections of other classes,
, for which
" changes.firePropertyChange;"
must be used to signal the inclusion of the new object in the containing class
This is fine because I can allow or prevent joborder audit entries by including or excluding the above method when the collection is updated with new objects.
The problem occurs when the joborder class contains a single object like jobprofile which is not part of a collection but is a one to one relationship.
How do I stop hibernate from seeing the addition of this single class as a modification to job order.
Is it necessary to include all classes in collections to maintain control over the firing of the update in hibernate

would appreciate any help
David Foss


*****joborder class**************

package mb.edu.jvmi.data;

import java.util.*;
import mb.edu.jvmi.data.lookup.JobOrderStatus;
import mb.edu.jvmi.data.lookup.PositionStatus;
import mb.edu.jvmi.data.lookup.Status;
import mb.edu.jvmi.data.valueObject.JobOrderValue;
import mb.edu.jvmi.util.Constants;
import mb.edu.jvmi.data.lookup.Union;

public class JobOrder
extends ModificationTracker
implements Cloneable {

private long id;
private int matchType;
private int totalPositions;
private int originalPositions;
private String estimatedJobStart;
private String comments;
private JobOrderStatus status;
private String traineeInd;
private JobProfile jobProfile;
private long hydroDescId;
private String hydroDesc;
private Date receivedDate;
private Union union;

/**
*@link aggregation
*@associates <{JobOrderContactInfo}>
*/
private Employer employer;

/**
*@link aggregation
*@associates <{Position}>
*/
private Set positions = new HashSet();
private Project project;

/**
*@link aggregation
*@associates <{ReferralRequest}>
*/

private Collection refReqList;

//---------------------------------------------------------------------------

public JobOrder() {
this.id = -1;
}

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public int getMatchType() {
return matchType;
}

public void setMatchType(int matchType) {
this.matchType = matchType;
}

public int getTotalPositions() {
return totalPositions;
}

public void setTotalPositions(int totalPositions) {
this.totalPositions = totalPositions;
}

public String getEstimatedJobStart() {
return estimatedJobStart;
}

public void setEstimatedJobStart(String estimatedJobStart) {
this.estimatedJobStart = estimatedJobStart;
}

public String getComments() {
return comments;
}

public void setComments(String comment) {
this.comments = comment;
}

public JobProfile getJobProfile() {
return jobProfile;
}

public void setJobProfile(JobProfile jobProfile) {
this.jobProfile = jobProfile;
}

public void addPosition(Position item) {
if (positions != null) {
positions.add(item);
item.setJobOrder(this);
}
}

public void removePosition(Position item) {
if (positions != null) {
positions.remove(item);
}
}

public Set getPositions() {
return positions;
}

public void setPositions(Set positions) {
this.positions = positions;
}

public void setRefReqList(Collection r) {
this.refReqList = r;
}

public Collection getRefReqList() {
return this.refReqList;
}

public void addReferralRequest(ReferralRequest item) {
if (item != null) {
refReqList.add(item);
item.setJobOrder(this);
changes.firePropertyChange("refReqList",null,item);
}
}

public String getTraineeInd() {
return traineeInd;
}

public void setTraineeInd(String traineeInd) {
this.traineeInd = traineeInd;
}

public boolean isTrainee() {
return traineeInd == null ? false :
(traineeInd.equals(Constants.TRUE_DEFAULT));
}

public void setTrainee(boolean trainee) {
this.traineeInd = (trainee ? Constants.TRUE_DEFAULT :
Constants.FALSE_DEFAULT);
}

public Project getProject() {
return project;
}

public void setProject(Project project) {
this.project = project;
}

public Employer getEmployer() {
return employer;
}

public void setEmployer(Employer employer) {
this.employer = employer;
}

public void setStatus(JobOrderStatus status) {
this.status = status;
}

public JobOrderStatus getStatus() {
return this.status;
}

public int getOriginalPositions() {
return originalPositions;
}

public void setOriginalPositions(int originalPositions) {
this.originalPositions = originalPositions;
}

public long getHydroDescId() {
return hydroDescId;
}

public void setHydroDescId(long hydroDescId) {
this.hydroDescId = hydroDescId;
}

/////////////////////////////////////////////////////////////////////

/**
* Return the amount of hired Positions on this JobOrder
* @return String
*/

public String getHiredPositions() {
int it = 0;
for (Iterator i = this.getPositions().iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
if (p.getStatus().equals(PositionStatus.HIRED) ||
p.getStatus().equals(PositionStatus.FINISHED)) {
it++;
}
}
Integer ir = new Integer(it);
return ir.toString();
}

/**
* Add a new Position and remove the old one.
* @param pos Position
*/

public void addNewPosition(Position pos) {
for (Iterator i = this.getPositions().iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
if (p.getId() == pos.getId()) {
i.remove();
}
}
this.addPosition(pos);
}

/**
* Get all unstarted Positions based on the stage.
* @param stage MatchStageDefinition
* @return Set
*/

public Set getUnstartedPositionsByStage(MatchStageDefinition stage) {
Set ret = new HashSet();
for (Iterator i = this.getPositions().iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
if (p.getStage().equals(stage) &&
p.getStatus().equals(PositionStatus.UNSTARTED)) {
ret.add(p);
}
}
return ret;
}

/**
* Remove an unhired Position from the JobOrder
*/

public void removeUnhiredPosition() {
for (Iterator i = this.getPositions().iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
if (!p.getStatus().equals(PositionStatus.HIRED)) {
i.remove();
break;
}
}
}

/**
* Get all started Positions based on the stage.
* @param stage MatchStageDefinition
* @return Set
*/

public Set getStartedPositionsByStage(MatchStageDefinition stage) {
Set ret = new HashSet();
for (Iterator i = this.getPositions().iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
if (p.getStage().equals(stage) &&
p.getStatus().equals(PositionStatus.STARTED)) {
ret.add(p);
}
}
return ret;
}

/**
* Get all Positions based on stage.
* @param stage MatchStageDefinition
* @return Set
*/

public Set getPositionsByStage(MatchStageDefinition stage) {
Set ret = new HashSet();
for (Iterator i = this.getPositions().iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
if (p.getStage().equals(stage)) {
ret.add(p);
}
}
return ret;

}

/**
* Get a specific Referral Request from the id.
* @param id String
* @return ReferralRequest
*/

private ReferralRequest getReferralRequestById(String id) {
for (Iterator i = refReqList.iterator(); i.hasNext(); ) {
ReferralRequest rr = (ReferralRequest) i.next();
if (rr.getId() == Long.parseLong(id)) {
return rr;
}
}
return null;
}

/**
* Get all unstarted Positions on the JobOrder
* @return Set
*/

public Set getUnstartedPositions() {
Set ret = new HashSet();
for (Iterator i = this.getPositions().iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
if (p.getStatus().equals(PositionStatus.UNSTARTED)) {
ret.add(p);
}
}
return ret;
}

/**
* Add a new Referral Request
* @param request ReferralRequest
* @param positions Set
*/

public void setNewReferralRequest(ReferralRequest request, Set positions) {

for (Iterator i = positions.iterator(); i.hasNext(); ) {
Position p = (Position) i.next();
request.addPosition(p);
if (this.getPositions().contains(p)) {
this.getPositions().remove(p);
this.getPositions().add(p);
}
else {
this.getPositions().add(p);
}
}

this.addReferralRequest(request);
changes.firePropertyChange("refReqList",null,request);
}

/**
* Get all AUTH_EXPIRED Referral Requests.
* @return Collection
*/

public Collection getExpiredRequests() {
Collection ret = new Vector();

for (Iterator i = refReqList.iterator(); i.hasNext(); ) {
ReferralRequest rr = (ReferralRequest) i.next();
if (rr.getStatus().equals(Status.AUTH_EXPIRED)) {
rr.setStatus(Status.COMPLETED);
ret.add(rr);
}
}

return ret;
}

public void setExpiredLists(Map lists) {
String[] requests = (String[]) lists.get("LISTS");
if (requests != null) {
for (int i = 0; i < requests.length; i++) {
String s = requests[i];
ReferralRequest rr = getReferralRequestById(s);
rr.setStatus(Status.AUTH_EXPIRED);
changes.firePropertyChange("refReqList",null,rr);
}
}
}

/**
* Get all ReferralRequests orderd by Date DESC
* @return List
*/

public List getReferralRequestsByDate() {
List ret = new Vector();
for (Iterator i = refReqList.iterator(); i.hasNext(); ) {
ReferralRequest rr = (ReferralRequest) i.next();
ret.add(rr);
}
Collections.sort(ret, new DateCmp());
Collections.reverse(ret);
return ret;
}

public void removeReferralRequest(ReferralRequest ref) {
for (Iterator i = refReqList.iterator(); i.hasNext(); ) {
ReferralRequest rr = (ReferralRequest) i.next();
if (rr.getId() == ref.getId()) {
i.remove();
break;
}
}
}

////////////////////////////////////////////////////////////////////////////

public void setValue(Object value) {
changes.addPropertyChangeListener(this);

JobOrderValue jobOrder = (JobOrderValue) value;
this.setUnion(jobOrder.getUnion());
this.setStatus(jobOrder.getStatus());
this.setComments(jobOrder.getComment());
this.setId(jobOrder.getIdValue());
this.setMatchType(jobOrder.getMatchTypeValue());
this.setReceivedDate(jobOrder.getReceivedDateValue());
this.setEstimatedJobStart(jobOrder.getEstimatedJobStart());
this.setTotalPositions(jobOrder.getTotalPositionsValue());
this.setOriginalPositions(jobOrder.getOriginalPositionsValue());
this.setEmployer(jobOrder.getEmployer());
this.setProject(jobOrder.getProject());
this.setTrainee(jobOrder.getTrainee());
this.setExpiredLists(jobOrder.getLists());
this.setHydroDescId(jobOrder.getHydroDescIdValue());

//If the id is -1 tell the employer that it is new
if (this.getId() == -1) {
changes.addPropertyChangeListener("newJobOrder", this.getEmployer());
changes.firePropertyChange("newJobOrder",null,this);
changes.removePropertyChangeListener("newJobOrder", this.getEmployer());
}
changes.removePropertyChangeListener(this);
}

public JobOrderValue getValue(JobOrderValue value) {
value.setUnion(this.getUnion());
value.setStatus(this.getStatus());
value.setIdValue(this.getId());
value.setMatchTypeValue(this.getMatchType());
value.setComment(this.getComments());
value.setCreationDateValue(this.getCreationDate());
value.setCreationUserId(this.getCreationUserId());
value.setReceivedDateValue(this.getReceivedDate());
value.setJobProfile(this.getJobProfile());
value.setLastModifiedDateValue(this.getLastModifiedDate());
value.setLastModifiedUserId(this.getLastModifiedUserId());
value.setEstimatedJobStart(this.getEstimatedJobStart());
value.setTotalPositionsValue(this.getTotalPositions());
value.setOriginalPositionsValue(this.getOriginalPositions());
value.setEmployer(this.getEmployer());
value.setProject(this.getProject());
value.setTrainee(this.isTrainee());
value.setHydroDescIdValue(this.getHydroDescId());
value.setHiredPositions(this.getHiredPositions());
value.setTempPositions(String.valueOf(this.getTotalPositions()));
return value;
}

public String getHydroDesc() {
return hydroDesc;
}

public void setHydroDesc(String hydroDesc) {
this.hydroDesc = hydroDesc;
}

public Date getReceivedDate() {
return receivedDate;
}

public void setReceivedDate(Date receivedDate) {
this.receivedDate = receivedDate;
}

public Union getUnion() {
return union;
}

public void setUnion(Union union) {
this.union = union;
}

public Object clone() {
JobOrder ret = new JobOrder();
ret.setComments("Copied from Job Order Number " + String.valueOf(this.getId()));
ret.setId( -1);
ret.setTotalPositions(0);
ret.setRefReqList(new HashSet());
ret.setTrainee(this.isTrainee());
ret.setStatus(JobOrderStatus.OPEN);
ret.setEmployer(this.getEmployer());
ret.setHydroDescId(this.getHydroDescId());
ret.setHydroDesc(this.getHydroDesc());
this.getProject().addJobOrder(ret);
return ret;
}


}

class DateCmp
implements Comparator {

/**
* compare
*
* @param o1 Object
* @param o2 Object
* @return int
*/
public int compare(Object o1, Object o2) {
ReferralRequest r1 = (ReferralRequest) o1;
ReferralRequest r2 = (ReferralRequest) o2;

return r1.getStartDate().compareTo(r2.getStartDate());
}

}





********modificationtracker which joborder extends**********

/* Generated by Together */

package mb.edu.jvmi.data;

import java.util.Date;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeSupport;

abstract public class ModificationTracker
implements SetValue, PropertyChangeListener {

public Date getCreationDate() {
return creationDate;
}

public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}

public String getCreationUserId() {
return creationUserId;
}

public void setCreationUserId(String creationUserId) {
if (creationUserId != null) {
this.creationUserId = creationUserId.toUpperCase();
}
else {
this.creationUserId = "";
}
}

public Date getLastModifiedDate() {
return lastModifiedDate;
}

public void setLastModifiedDate(Date lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}

public String getLastModifiedUserId() {
return lastModifiedUserId;
}

public void setLastModifiedUserId(String lastModifiedUserId) {
if (lastModifiedUserId != null) {
this.lastModifiedUserId = lastModifiedUserId.toUpperCase();
}
else {
this.lastModifiedUserId = "";
}
}

public boolean isCollectionChanged() {
return collectionChanged;
}

public void setCollectionChanged(boolean collectionChanged) {
this.collectionChanged = collectionChanged;
}

/**
* propertyChange
*
* @param evt PropertyChangeEvent
*/
public void propertyChange(PropertyChangeEvent evt) {
boolean changed = true;
if (evt.getOldValue() instanceof String ||
evt.getNewValue() instanceof String) {
changed = checkNullString(evt.getOldValue(), evt.getNewValue());
}
if (changed) {
this.setCollectionChanged(true);
}
}

private boolean checkNullString(Object oldObj, Object newObj) {

String s1 = (String) oldObj;
String s2 = (String) newObj;

s1 = s1 == null ? "" : s1;
s2 = s2 == null ? "" : s2;

if (s1.trim().length() == 0 & s2.trim().length() == 0) {
return false;
}
else {
return true;
}
}

public PropertyChangeSupport getChanges() {
return this.changes;
}

private Date creationDate;
private String creationUserId;
private Date lastModifiedDate;
private String lastModifiedUserId;
private boolean collectionChanged = false;
protected PropertyChangeSupport changes = new PropertyChangeSupport(this);
}


***mapping for job order

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<!--Job Order-->

<class name="mb.edu.jvmi.data.JobOrder" table="JOB_ORDER">

<id name="id" type="long" unsaved-value="-1" >
<column name="ID" sql-type="integer" not-null="true"/>
<generator class="sequence">
<param name="sequence">JOB_ORDER_SEQ</param>
</generator>
</id>

<one-to-one name="jobProfile" class="mb.edu.jvmi.data.JobProfile"/>

<many-to-one name="project" class="mb.edu.jvmi.data.Project" column="PROJECT_ID" not-null="true"/>
<property name="comments" column="COMMENTS" type="string"/>
<property name="estimatedJobStart" column="ESTIMATED_JOB_START" type="string"/>
<property name="totalPositions" column="TOTAL_POSITIONS" type="int"/>
<property name="originalPositions" column="ORIGINAL_POSITIONS" type="int"/>
<property name="receivedDate" column="RECEIVED_DATE" type="timestamp"/>
<many-to-one name="status" class="mb.edu.jvmi.data.lookup.JobOrderStatus" column="STATUS_ID"/>

<property name="traineeInd" column="TRAINEE_IND" type="string"/>
<property name="creationDate" column="CREATION_DATE" type="date"/>
<property name="creationUserId" column="CREATION_USER_ID" type="string"/>
<property name="lastModifiedDate" column="MODIFIED_DATE" type="timestamp"/>
<property name="lastModifiedUserId" column="MODIFIED_USER_ID" type="string"/>
<property name="hydroDescId" column="HYDRO_DESC_ID" type="long"/>
<property name="hydroDesc" formula="(SELECT CH.HYDRO_DESC FROM HYDRO_DESC CH WHERE CH.ID = HYDRO_DESC_ID)" type="string"/>

<many-to-one name="employer" class="mb.edu.jvmi.data.Employer" column="EMPLOYER_ID" not-null="true"/>
<many-to-one name="union" class="mb.edu.jvmi.data.lookup.Union" column="UNION_ID"/>

<set name="refReqList" lazy="true" inverse="true" cascade="all-delete-orphan" order-by="ID ASC">
<key column="JOB_ORDER_ID"/>
<one-to-many class="mb.edu.jvmi.data.ReferralRequest"/>
</set>

<set name="positions" lazy="true" inverse="true" cascade="all-delete-orphan">
<key column="JOB_ORDER_ID"/>
<one-to-many class="mb.edu.jvmi.data.Position"/>
</set>
</class>

<!--Job Order Summary-->

<class name="mb.edu.jvmi.data.summary.JobOrderSummary" table="V_JOB_ORDER_SUMMARY" mutable="false">

<id name="id" type="string" unsaved-value="null" >
<column name="ID" sql-type="integer" not-null="true"/>
<generator class="hilo"/>
</id>

<property name="positions" column="TOTAL_POSITIONS" type="string"/>
<property name="comments" column="COMMENTS" type="string"/>
<property name="employer" column="EMPLOYER" type="string"/>
<property name="estimatedJobStart" column="ESTIMATED_JOB_START" type="string"/>
<property name="nocCode" column="CODE" type="string"/>
<property name="jobDesc" column="TITLE" type="string"/>
<property name="hydroDesc" column="HYDRO_DESC" type="string"/>
<many-to-one name="status" class="mb.edu.jvmi.data.lookup.JobOrderStatus" column="STATUS_ID"/>
</class>

<!--Job Profile-->

<class name="mb.edu.jvmi.data.JobProfile" table="JOB_PROFILE">
<id name="id" type="long" unsaved-value="-1" >
<column name="ID" sql-type="integer" not-null="true"/>
<generator class="foreign">
<param name="property">jobOrder</param>
</generator>
</id>

<one-to-one name="jobOrder" class="mb.edu.jvmi.data.JobOrder" cascade="save-update" constrained="true"/>
<many-to-one name="nocDef" class="mb.edu.jvmi.data.NOCDefinition" column="NOC_ID"/>

<map name="questionnaireResponses" lazy="true" table="JOB_QUEST_RESP" cascade="all-delete-orphan">
<key column="PROFILE_ID"/>
<index-many-to-many column="OC_ID" class="mb.edu.jvmi.data.NOCDefinitionCategory"/>
<many-to-many column="ANSWER_ID" class="mb.edu.jvmi.data.JobProfileAnswers"/>
</map>

<property name="traineeGraduateInd" column="TRAINEE_GRAD_IND" type="string"/>
<property name="confirmedInd" column="CONFIRMED_IND" type="string"/>

<property name="creationDate" column="CREATION_DATE" type="date"/>
<property name="creationUserId" column="CREATION_USER_ID" type="string"/>
<property name="lastModifiedDate" column="MODIFIED_DATE" type="timestamp"/>
<property name="lastModifiedUserId" column="MODIFIED_USER_ID" type="string"/>

</class>

<!--Job Answers class-->

<class name="mb.edu.jvmi.data.JobProfileAnswers" table="JOB_QUEST_ANSWERS">
<id name="id" type="long" unsaved-value="-1" >
<column name="ID" sql-type="integer" not-null="true"/>
<generator class="sequence">
<param name="sequence">JOB_ANSW_SEQ</param>
</generator>
</id>

<many-to-one name="jobProfile" class="mb.edu.jvmi.data.JobProfile" column="JOB_PROFILE_ID"/>

<bag name="answers" lazy="true" inverse="false" cascade="all-delete-orphan">
<key column="ANSWER_ID"/>
<one-to-many class="mb.edu.jvmi.data.JobResponse"/>
</bag>
</class>

<!--Job Response-->

<class name="mb.edu.jvmi.data.JobResponse" table="JOB_RESPONSES">
<id name="id" type="long" unsaved-value="-1" >
<column name="ID" sql-type="integer" not-null="true"/>
<generator class="sequence">
<param name="sequence">JOB_OPTION_SEQ</param>
</generator>
</id>
<many-to-one name="answer" class="mb.edu.jvmi.data.JobProfileAnswers" column="ANSWER_ID"/>
<many-to-one name="nocOption" class="mb.edu.jvmi.data.NOCDefinitionOption" column="CAT_SKILL_ID"/>

<set name="subResponses" lazy="true" inverse="false" cascade="all-delete-orphan">
<key column="RESPONSE_ID"/>
<one-to-many class="mb.edu.jvmi.data.JobSubResponse"/>
</set>

</class>

<!--Job Sub Response-->

<class name="mb.edu.jvmi.data.JobSubResponse" table="JOB_SUB_RESPONSE">
<id name="id" type="long" unsaved-value="-1" >
<column name="ID" sql-type="integer" not-null="true"/>
<generator class="sequence">
<param name="sequence">JOB_SUB_SEQ</param>
</generator>
</id>

<many-to-one name="nocSubOption" class="mb.edu.jvmi.data.NOCSubOption" column="SUB_OPTION_ID"/>
<property name="expiryDate" column="EXPIRY_DATE" type="date"/>
<many-to-one name="exp" class="mb.edu.jvmi.data.lookup.Experience" column="EXP"/>
<many-to-one name="jobResponse" class="mb.edu.jvmi.data.JobResponse" column="RESPONSE_ID"/>
</class>

<!--Job Profile Summary-->

<class name="mb.edu.jvmi.data.summary.JobProfileSummary" table="V_JOB_PROFILE_SUMMARY" mutable="false">
<id name="id" type="string" unsaved-value="null" >
<column name="JP_ID" sql-type="integer" not-null="true"/>
<generator class="hilo"/>
</id>

<property name="code" column="NOC_CODE" type="string"/>
<property name="title" column="NOC_TITLE" type="string"/>
<property name="graduate" column="TRAINEE_GRAD_IND" type="string"/>
</class>

<!--Position-->

<class name="mb.edu.jvmi.data.Position" table="POSITION">
<id name="id" type="long" unsaved-value="-1" >
<column name="ID" sql-type="integer" not-null="true"/>
<generator class="sequence">
<param name="sequence">POSITION_SEQ</param>
</generator>
</id>

<property name="dateFilled" column="DATE_FILLED" type="timestamp"/>
<many-to-one name="jobOrder" class="mb.edu.jvmi.data.JobOrder" column="JOB_ORDER_ID"/>
<many-to-one name="referralRequest" class="mb.edu.jvmi.data.ReferralRequest" column="REFERRAL_REQUEST_ID"/>
<one-to-one name="successfulReferral" class="mb.edu.jvmi.data.Referral" property-ref="position" cascade="save-update" />
<many-to-one name="stage" class="mb.edu.jvmi.data.MatchStageDefinition" column="MATCH_STAGE_ID"/>
<many-to-one name="status" class="mb.edu.jvmi.data.lookup.PositionStatus" column="STATUS"/>
</class>


<query name="JobOrderSummaryListQuery">
<![CDATA[from mb.edu.jvmi.data.summary.JobOrderSummary as jos
where ((:id is null OR :id like '' OR jos.id like :id) and
(:jobDesc is null OR :jobDesc = '' OR upper(jos.jobDesc) like upper(:jobDesc)
OR upper(jos.hydroDesc) like upper(:jobDesc)) and
(:status = -1 OR :status=jos.status.id))
order by jos.id ASC ]]>
</query>

<query name="jobOrderEmployerListLookup">
<![CDATA[from mb.edu.jvmi.data.summary.EmployerSummary as es
where es.id = (select jo.employer.id from mb.edu.jvmi.data.JobOrder as jo
where jo.id = :id)]]>
</query>

<query name="jobOrderLookupQuery">
<![CDATA[from mb.edu.jvmi.data.summary.JobOrderSummary as es
where es.id in (select jo.id from mb.edu.jvmi.data.JobOrder as jo
where jo.employer.id = :id)
order by es.id DESC]]>
</query>

<query name="jobOrderProjectLookup">
<![CDATA[from mb.edu.jvmi.data.summary.ProjectSummary as ps
where ps.id = (select jo.project.id from mb.edu.jvmi.data.JobOrder as jo
where jo.id = :id)]]>
</query>

<query name="jobOrderProfileListLookup">
<![CDATA[from mb.edu.jvmi.data.summary.JobProfileSummary as ps
where ps.id = :id]]>
</query>

<sql-query name="jobOrderProjectListLookup">
<return alias="project" class="mb.edu.jvmi.data.summary.ProjectSummary"/>
SELECT {project.*}
FROM PROJECT {project}
WHERE {project}.ID IN (SELECT PROJECT_EMPLOYER.PROJECT_ID
FROM PROJECT_EMPLOYER, EMPLOYER
WHERE EMPLOYER_ID = ID AND
EMPLOYER.ID = :id)
</sql-query>
</hibernate-mapping>




Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.