Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] unknown state or association field since upgrading to 1.1

Currently getting this message in my server logs when try to run a JPQL
query- 
Caused by: Exception [EclipseLink-8030] (Eclipse Persistence Services -
1.1.0.r3634): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Error compiling the query [SELECT model FROM
Zdk01cntlf AS model WHERE model.lineofBusiness = :lineofBusiness AND
model.state = :state AND model.type = :type AND model.reasonCode =
:reasonCode ORDER BY model.effectiveDate ASC ], line 1, column 50: unknown
state or association field [lineofBusiness] of class
[com.xxx.jpa.domain.Zdk01cntlf].

Here is the code I am executing - 

 final String queryString = "SELECT model FROM Zdk01cntlf AS model WHERE
model.lineofBusiness =  
   :lineofBusiness AND model.state = :state AND model.type = :type AND
model.reasonCode = :reasonCode   
   ORDER BY model.effectiveDate ASC ";

final Query query = getEntityManager().createQuery(queryString);

The entity looks like this - 
@Entity
@Table(name = "ZDK01CNTLF", schema = "GNDATA")
public class Zdk01cntlf implements Serializable {

   private Zdk01cntlfId id;
   private String effectiveDate; 
   private String numberofDays;
	
   public Zdk01cntlf() {
     super();
   } 
	   
    @EmbeddedId
    public Zdk01cntlfId getId() {
        return id;
    }

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

    @Column(name = "CNT_REF_FILE_EFF_DT")
    public String getEffectiveDate() {
	return this.effectiveDate;
    }
    
    public void setEffectiveDate(String effectiveDate) {
	this.effectiveDate = effectiveDate;
    }
	   
    @Column(name = "CNT_REF_FILE_DAYS_NOT")
    public String getNumberOfDays() {
 	return this.numberofDays;
    }
}

And the EmbeddedId looks like -
@Embeddable
public class Zdk01cntlfId implements Serializable {

    private String lineofBusiness; 
    private String state; 
    private String type; 
    private String reasonCode; 

    /** default constructor */
    public Zdk01cntlfId() {
    }

    public Zdk01cntlfId(String lineofBusiness, String state, String type,
String reasonCode) {
        super();
       ....
    }

    // Property accessors

    @Column(name = "CNT_REF_FILE_LINE")
    public String getLineOfBusiness() {
        return this.lineofBusiness;
    }

    public void setLineOfBusiness(String lineofBusiness) {
        this.lineofBusiness = lineofBusiness;
    }
       
    @Column(name = "CNT_REF_FILE_STATE")
    public String getState() {
        return this.state;
    }

    public void setState(String state) {
        this.state = state;
    }
       
    @Column(name = "CNT_REF_FILE_CAN_TYPE")
    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }
       
    @Column(name = "CNT_REF_FILE_CAN_REASON")
    public String getReasonCode() {
        return this.reasonCode;
    }

    public void setReasonCode(String reasonCode) {
        this.reasonCode = reasonCode;
    }

   .... hashCode and Equals ommitted

This has just started showing up since we moved from 1.0.2 to 1.1 

-- 
View this message in context: http://www.nabble.com/unknown-state-or-association-field-since-upgrading-to-1.1-tp22563222p22563222.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top