Resolved JPA validation errors

These were partially caused by an old Hibernate validator which has now
been replaced by the EclipseLink validator for the current JPA standard.
Another error was caused by the use of non-standard JPQL in the user
search query which has now been replaced by a standardized one.
This commit is contained in:
Kai S. K. Engelbart 2020-06-11 11:17:22 +02:00
parent 12a0ab5a37
commit 744f55de58
2 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,3 @@
eclipse.preferences.version=1
org.eclipse.jpt.core.platform=hibernate2_1
org.eclipse.jpt.core.platform=eclipselink2_5
org.eclipse.jpt.jpa.core.discoverAnnotatedClasses=true

View File

@ -31,9 +31,10 @@ import envoy.data.User.UserStatus;
@NamedQuery(
name = User.findContacts,
query = "SELECT u.contacts FROM User u WHERE u = :user"
), @NamedQuery(
),
@NamedQuery(
name = User.searchByName,
query = "SELECT u FROM User u WHERE (lower(u.name) LIKE lower(:searchPhrase) AND u <> :context AND NOT :context in elements(u.contacts))"
query = "SELECT u FROM User u WHERE (lower(u.name) LIKE lower(:searchPhrase) AND u <> :context AND :context NOT MEMBER OF u.contacts)"
)
})
public class User extends Contact {