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

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