Differences between TopLink and EclipseLink

The default persistence manager in Netbeans Release 6.8 has changed from TopLink to EclipseLink and I will list error messages and differences that I find as I go along.

1.
ErrorMessage

Exception [EclipseLink-8034] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Error compiling the query [findUserByEmail: SELECT u FROM theuser u WHERE u.email = :email]. Unknown entity type [theuser].
at org.eclipse.persistence.exceptions.JPQLException.entityTypeNotFound(JPQLException.java:483)

Solution
EclipseLink is case sensitive. If your entity is named “TheUser” (yes, it is a dumm name for an entity) your named query should be:
@NamedQueries({
@NamedQuery(
name="findUserByEmail",
query="SELECT u FROM TheUser u WHERE u.email = :email"
)
})

and not ...SELECT u FROM theuser....

Tags: , , , ,

One Response to “Differences between TopLink and EclipseLink”

  1. brian murphy says:

    cheers for that, excellent concise answer to my query

Leave a Reply