File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes Entity Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Entity Bean" Watch "Entity Bean" New topic

Entity Bean

Kalyani Nayak

Joined: Jan 01, 2006
Posts: 25
I am using JBoss4.0.2
I successfully deployed entity bean, session bean.
I am using avenir jdbc driver.
While creating entity bean, i am passing the primary key (java.lang.Float).
I want it to be autogenerated. Should, i must use any third party IDGenerator, or is there inbuilt IDGenerator comes with JBoss, and how to use it.
If third party IDGenerator class must be used then how to use it?
Also one thing i need to know is, when i deployed the entity bean first time, it created a new table with the same name of entity bean, which i given in ejb-jar.xml in the tag <ejb-name>, but i want the existing table to map to the entity bean, and for that i also have given <abstract-schema-name>tablename</abstract-schema-name>, is something missing, please help me.
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
How exactly would you autogenerate a float? Given a currently-allocated id value 'x', what is 'the next value of x?'. Since database floating-point resolution can differ significantly from how Java represents floats, plus all the usual concerns about rounding and decimal-to-binary conversion noise, this seems like a really dangerous choice of type for a primary key.

Reid - SCJP2 (April 2002)
I agree. Here's the link:
subject: Entity Bean
It's not a secret anymore!