Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Exception with ManytoOne with latest version of eclipselink.jar

In the previous version we were using 2.2.0.v20100731-r7961 and were not seeing this issue -

Exception [EclipseLink-6094] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.QueryException

Exception Description: The parameter name [LOB_STATE_ID] in the query's selection criteria does not match any parameter name defined in the query.

Query: ReadAllQuery(name="cpLocations" referenceClass=CpLocation sql="SELECT t0.LOCATION_ID, t1.LOCATION_ID, t0.BUILDINGS_SAME_ADDRESS, t1.CLASS_CODE, t0.COUNTY_CODE, t0.COUNTY_NAME, t0.LOCATION_NUMBER, t1.EARTHQUAKE_ZONE, t1.FIRE_PROTECTION_FD, t1.FIRE_PROTECTION_HYDRANT, t0.LOCATION_STATE, t1.PREMIUM_ACTUAL, t1.PROTECTION_CLASS, t1.PROTECTION_CLASS_OVERRIDE, t1.TERR_MULT, t1.TERRITORY, t1.TERRITORY_BCEG, t1.TERRITORY_PREMOP, t1.TERRITORY_TIER, t0.ACTION_CODE, t1.LOB_STATE_ID, t0.TRANSACTION_ID FROM CP_LOCATION t0, CP_LOCATION_PKG t1 WHERE ((t1.LOB_STATE_ID = ?) AND (t1.LOCATION_ID = t0.LOCATION_ID))")

      at org.eclipse.persistence.exceptions.QueryException.parameterNameMismatch(QueryException.java:1050)

      at org.eclipse.persistence.internal.expressions.ParameterExpression.getValue(ParameterExpression.java:246)

 

Here are my entities -

@Entity

@Table(name = "CP_LOCATION")

@Cache(alwaysRefresh = true)

@SecondaryTable(name = "CP_LOCATION_PKG")

@Converter(name = "boolean", converterClass = com.gmrc.jpa.domain.mappings.converters.BooleanYNConverter.class)

public class CpLocation extends BaseDomain implements Comparable<CpLocation> {

 

    // Fields

 

   @Id

    @GeneratedValue(strategy = GenerationType.IDENTITY)

    @Column(name = "LOCATION_ID", unique = true, nullable = false, precision = 11, scale = 0)

    private Long locationId;

 

    @ManyToOne(cascade = CascadeType.ALL)

    @JoinColumn(name = "TRANSACTION_ID", nullable = false)

    private CpTransaction cpTransaction;

 

    @Column(name = "LOCATION_NUMBER", nullable = false)

    private Integer displayNumber = Integer.valueOf(0); // same as location number

    @Column(name = "TERRITORY_TIER", length = 10, table = "CP_LOCATION_PKG")

    private String territoryTier;

 

    // bi-directional many-to-one association to CpLobState

    @ManyToOne()

    @JoinColumn(name = "LOB_STATE_ID", table = "CP_LOCATION_PKG")

    private CpLobState cpLobState;

 

   @Entity

   @Table(name = "CP_LOB_STATE")

   @Converter(name = "boolean", converterClass = com.gmrc.jpa.domain.mappings.converters.BooleanYNConverter.class)

   public class CpLobState extends BaseDomain {

 

    // Fields

    @Id

    @GeneratedValue(strategy = GenerationType.IDENTITY)

    @Column(name = "LOB_STATE_ID", unique = true, nullable = false, precision = 11, scale = 0)

    private Long lobStateId;

 

    @ManyToOne(cascade = CascadeType.ALL)

    @JoinColumn(name = "LOB_ID", nullable = false)

    private CpLob cpLob;

 

    @Column(name = "LOB_STATE", nullable = false, length = 2)

    private String lobState;

 

 

Is there something different now that I need to do to fix this?

 

This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication. Thank you.


Back to the top