Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Embeded Object JPQL query not working
Embeded Object JPQL query not working [message #1387591] Wed, 25 June 2014 09:47
Mahendran Mahesh is currently offline Mahendran MaheshFriend
Messages: 1
Registered: June 2014
Junior Member
Hi All,
I am trying to upgrade a project from Hibernate to eclipselink. resolved many issues. Now getting a error while starting the server as below. Kindly let me know if i made any mistakes in my code/JPQL. Thanks for your help..

The JPQL uses embedded object attributes in the query.

Exception Description: Error compiling the query [TempTransactionTransformAuditQuery:
select obj from TempTransactionTransform obj where obj.tempTransactionTsformPK.altIdType= :id and obj.tempTransactionTransformPK.actualValue= :id and obj.tempTransactionTransformPK.altenateValue= :id],
line 1, column 82: unknown state or association field [altIdType] of class [com.test.wm.refdata.model.TempTransactionTransformPK].



JPQL in orm.xml:
select obj from TempTransactionTransform obj where obj.tempTransactionTransformPK.altIdType= :altIdType and obj.tempTransactionTransformPK.actualValue= :actualValue and obj.tempTransactionTransformPK.altenateValue= :altenateValue

JavaCode:

@Entity
@Table(name="T_TRANSACTION_TRANSFORM")
public class TempTransactionTransform{

protected TempTransactionTransformPK tempTransactionTransformPK;
protected String fieldName;
private String altIdSubType;
private String transNarration;
protected String amcCode;
private String fieldDescription;
private String altIdSubTypeDesc;

@Id
@Embedded
@AttributeOverrides({
@AttributeOverride(name = "altIdType", column = @Column(name="ALT_ID_TYPE")),
@AttributeOverride(name = "altenateValue", column = @Column(name="ALT_FIELD_VALUE")),
@AttributeOverride(name = "actualValue", column = @Column(name="ACTUAL_FIELD_VALUE"))
})

public TempTransactionTransformPK getTempTransactionTransformPK() {
return tempTransactionTransformPK;
}

public void setTempTransactionTransformPK(TempTransactionTransformPK tempTransactionTransformPK) {
this.tempTransactionTransformPK = tempTransactionTransformPK;
}
@Column(name="FIELD_NAME")
public String getFieldName() {
return fieldName;
}

public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
@Column(name="TRANS_NARRATION")
public String getTransNarration() {
return transNarration;
}

public void setTransNarration(String transNarration) {
this.transNarration = transNarration;
}
@Column(name = "AMC_CODE")
public String getAmcCode() {
return amcCode;
}

public void setAmcCode(String amcCode) {
this.amcCode = amcCode;
}




=======

@Embeddable
public class TempTransactionTransformPK{

/** Creates a new instance of TempTransactionTransformPK */
public TempTransactionTransformPK() {
}
@Basic
@Column(name="ALT_ID_TYPE")
protected String altIdType;
@Basic
@Column(name="ACTUAL_FIELD_VALUE")
protected String altenateValue;
@Basic
@Column(name="ALT_FIELD_VALUE")
protected String actualValue;

============
Previous Topic:EclipseLink 2.3: One-to-one association
Next Topic:Generating tables from entities
Goto Forum:
  


Current Time: Sun Mar 01 03:01:54 GMT 2015

Powered by FUDForum. Page generated in 0.02836 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software