Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJBQL questions  RSS feed

Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some questions about ejbql which I want to be sure of. They are mentioned in the spec, but some mock answers I got made me doubt

1. An ejb query defined for a finder method cannot return entities other than the entity for which the query is defined. Is this true ?

For example, if I have two entities in unidirectional one-one relation with each other (entityA -----> entityB) then the query defined for entityA may not return entityB.

So, the query:

"select object(a.b) from EntityA as a" would be incorrect when it is associated with a finder method ?
But correct when associated with a select method ?

2. In that same relationship, entityB MUST have local interfaces and entityA may not list the accessor methods for the CMR fields in its remote interface but it is allowed to do this for the local interface ?

Thanks !
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!