I have 1 to n relation in my EntityBean(Company to Persons, JBoss 3.0 use CMR )
and there will have more than 10000 persons in one Company
when i create a person i will add to company
but i find JBoss will call SQL to find all Person when i get Collection
and it will wast a lot of time(in JDBC i just only set the foreign key, it is very fast)
code is like:
//there will have a SQL call like-->
//SELECT primaryId from PERSON
//where PERSON.company = ?
In JBoss (or EJB)
Is container always execute SQL when i get Collection??( there may be some setting i dont know)
or is there any other way can fast build the relationship ??
Thanks a lot