Community
Participate
Working Groups
Build Identifier: 2.3.0-20110326.050514-69 Get this exception when a class X extend an entity class Y and class X has attribute to change the column name for primary field in class Y Reproducible: Always Steps to Reproduce: (Only annotations used) 1. create class Y as an entity class with primary field 2. create class X that extends class Y and has change attribute to change column name for primary field that is in class Y 3. Create Class A that has an attribute that uses class X 4. persist class A
What does this mean? "2. create class X that extends class Y and has change attribute to change column name for primary field that is in class Y" Can you provide some sample code?
Closing as INVALID due to the lack of information. Please feel free to reopen if you can provide more information.
Customer provided info: Hope this clarifies. If not let me know and I will work on a full > example when I have some time > > ------Class Y > @Entity > class Y { > @Id > private String yId; > } > > ------------Class X > @Entity > @AttributeOverride(name = "yId", column = @Column(name = "xId")) > class X extends Y { > }
If possible, please make updates to the bug instead of replying to the email. I am reopening the bug, but can you please provide the query creation code and the full stack trace?
Switched to Hibernate due to poor support for complex generics and too much difficulty in getting issues resolved
I've got the same issue. It happens where child entity refers not to parent's primary key but to natural key and parent has cascaded association. Here is the sample code: @Entity class Parent { @Id private String id; private String key; @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent") List<Child> children; } @Entity class Child { @Id private String id; @ManyToOne @JoinColumn(referencedColumnName = "ket") Parent parent; } ... entityManager.remove(parent); Exception [EclipseLink-6094] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.QueryException Exception Description: The parameter name [uuid] in the query's selection criteria does not match any parameter name defined in the query. Query: DeleteObjectQuery(DocumentNode{id=101, name='node101', type=FOLDER, version='null', length=0}) at org.eclipse.persistence.exceptions.QueryException.parameterNameMismatch(QueryException.java:1096) at org.eclipse.persistence.internal.expressions.ParameterExpression.getValue(ParameterExpression.java:288) at org.eclipse.persistence.internal.databaseaccess.DatabaseCall.translate(DatabaseCall.java:1102) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:241) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.deleteAll(DatasourceCallQueryMechanism.java:127) at org.eclipse.persistence.queries.DeleteAllQuery.executeDatabaseQuery(DeleteAllQuery.java:163) at org.eclipse.persistence.queries.DeleteAllQuery.executeDeleteAll(DeleteAllQuery.java:222) at org.eclipse.persistence.mappings.OneToManyMapping.deleteAll(OneToManyMapping.java:307) at org.eclipse.persistence.mappings.OneToManyMapping.preDelete(OneToManyMapping.java:1144) at org.eclipse.persistence.descriptors.DescriptorQueryManager.preDelete(DescriptorQueryManager.java:1042) at org.eclipse.persistence.queries.DeleteObjectQuery.executeDatabaseQuery(DeleteObjectQuery.java:172) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904) at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:803) at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108) at org.eclipse.persistence.queries.DeleteObjectQuery.executeInUnitOfWorkObjectLevelModifyQuery(DeleteObjectQuery.java:119) at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1790) at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(CommitManager.java:342) at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(CommitManager.java:291) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1444) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1531) at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:278) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1169) at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:134)
Workaround: the issue reproduces only when @OneToMany end has an attribute "orphanRemoval = true" defined(I missed it in my sample code above). Without it the issue doesn't reproduce.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink