(EJB3)
Is it bad design to use primitives such as int, long, boolean etc.. in Entity 
beans?

The reason I ask is that I created an entity on the client but didnt set the 
primary key (which was a long). I forgot to put code in to set the primary key 
before calling persist. As a result it was added fine with a primary key of 0. 
I realised this and ran the code again and of course got a duplicate primary 
key exception.

This led me to think that if I had all my entities not using any primitive 
types then any fields that I didnt set that were marked as NOT NULL would throw 
errors when attempting to persist them. 

Is this a better way to go?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3926330#3926330

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3926330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to