Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Exception when calling entityManager.remove: The parameter name [version] in the query's selection criteria does not match any parameter name defined in the query

At the first sight it should work. I haven’t used this type of mapping before. Maybe you can file a bug into bugzilla for this case.

 

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EclipseLink

 

Martin

 

From: Andreas Joseph Krogh [mailto:andreas@xxxxxxxxxx]
Sent: 7. září 2014 16:35
To: eclipselink-users@xxxxxxxxxxx
Subject: Re: [eclipselink-users] Exception when calling entityManager.remove: The parameter name [version] in the query's selection criteria does not match any parameter name defined in the query

 

På søndag 07. september 2014 kl. 16:26:56, skrev Martin Vojtek <martin.vojtek@xxxxxxxxxx>:

Hi Andreas,

 

You are probably using optimistic version locking.

 

http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Locking/Optimistic_Locking

 

You can use pessimistic locking or add version column to BudgetGroup object.

 

I use Optimistic Locking, and have a version-column in a JOIN'ed superclass.

 

My class-hierarchy looks like this:

 

@MappedSuperclass

AbstractDomainObject

^

|

@Entity

@Inheritance(strategy = InheritanceType.JOINED)

AbstractEntityObject

^

|

@MappedSuperclass

AbstractChangableEntity

^

|

@Entity

BudgetGroup

 

AbstractDomainObject has @Version:

 

    @Version
    @Column(name = "version")
    private long version;

 

 

This should be a valid configuration.

 

--

Andreas Joseph Krogh

CTO / Partner - Visena AS

Mobile: +47 909 56 963

 


Back to the top