Until now, I've been using Castor soley with my web application (.war), but
am now adding other clients (i.e. Swing and maybe another separate web
client). Given this, packaging castor.jar with my .war/web application and
accessing entities directly (.web app -> castor) is no longer sufficient.
As a result, I'm changing the architecture so that the existing .war/web
app (and the other future clients, swing or other web apps) now access
Castor via Stateless Session Beans (SLSB), which are accessing the Castor
JDO object via JNDI.
My question is, when creating a new entity (instance) in either a Swing
client or web app, what is the best method for obtaining the entity's id
once its been created?
The process would look something like:
CLIENT -> SLSB.createPerson(Person p) -> JDO from JNDI ->
jdo.getDatabase().create(p)
Basically, the SLSB.createPerson(...) method will know the value of Person
p's id field, but the CLIENT will not know.
Is it typical to:
1) have the SLSB method return the entire entity (in this case, Person),
as the entity
may contain dependent entities?, or
2) have the SLSB method return only the value assigned by Castor to the
entity's id field?
I'm leaning towards #1 because of the dependent entities, but worry about
extra overhead (i.e. sending field data back to the CLIENT that the CLIENT
already knows about)...
Just wondering how others are using Castor via SLSB?
Thank you.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev