[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-15 Thread damianharvey
Is your ID field in your Entity annotated with @GeneratedValue ? This caused me all sorts of grief with my Seam Gen'd project until I figured out it's significance. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045689#4045689 Reply to the post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-15 Thread rhinosystemsinc
I fixed the problem - it was that the persistance.xml had the following defined. I needed this to run the seam generate-entities or else all the tables in the system space were being generated to. Thank you for your code suggestion. View the original post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-15 Thread rhinosystemsinc
I fixed the problem - it was that the persistance.xml had the following defined. I needed this to run the seam generate-entities or else all the tables in the system space were being generated to. Thank you for your code suggestion. -Joel View the original post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-15 Thread rhinosystemsinc
my xml didn't show up in the previous post - I will enclose in code tags - this is what I had to get rid of : property name=hibernate.default_schema value=NM/ View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045823#4045823 Reply to the post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-14 Thread rhinosystemsinc
Sorry. I know this is slightly off topic of your question - please forgive me. but I am still having the same problem whereby, it says the sequence does not exists... I am using jboss-4.0.5.GA w/EJB installed on Window XP runing 10g XE on same machine. This one issue is enough to kill my

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-12 Thread [EMAIL PROTECTED]
This is really turning into a Hibernate question. Your entity should have an identifier after you call persist(o), no matter where as long as you have a sequence-style generator. I recommend enabling the Hibernate DEBUG log and posting on the Hibernate forum. View the original post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-12 Thread [EMAIL PROTECTED]
Well, if Hibernate says the sequence isn't there it probably isn't there or can't be seen by the user Hibernate connects with. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045198#4045198 Reply to the post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-12 Thread monkeyden
anonymous wrote : Your entity should have an identifier after you call persist(o), no matter where as long as you have a sequence-style generator. So Hibernate actually calls the mutator after persisting (or implicitly refreshes)? View the original post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-12 Thread monkeyden
Your sequence looks correct. I don't have the code here but I think I'm doing this: em.persist(entity); | em.flush(); | em.refresh(entity); to get the sequence. I don't think EntityManager uses the primary key to find the persistent state. View the original post :

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-12 Thread [EMAIL PROTECTED]
Hibernate sets the identifier property, through field or setter access. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045216#4045216 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045216

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-12 Thread [EMAIL PROTECTED]
(You don't need an INSERT to get the next identifier value from a sequence.) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045217#4045217 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045217

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread [EMAIL PROTECTED]
em.persist(o); em.flush(); o.getId(); View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4044895#4044895 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4044895 ___ jboss-user mailing

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread waheed.murad
This is how i have used oracle sequence. sequenceName=CUSTOMER_SEQ: Is the name is the name of your database sequence. name=CUSTOMER_SEQUENCE: U will use in Entity as i have used it with id field. / @Entity @Name(Customer) @Scope(EVENT)

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread waheed.murad
Thanks for your reply christian well and injecting EntityManager like this in my action class @PersistenceContext(unitName=myDatabase) protected EntityManager em; i think it will not allow me to use em.flush function as i think so i have tried it before and it throughs exception.(As per my

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread rhinosystemsinc
Hello, can someone give me some advice on how to setup a generated ID with Oracle, hibernate and SEAM... I have been trying to do a variety of ways - like before insert triggers and coupled with @GeneratedValue(strategy=GenerationType.IDENTITY) or @GeneratedValue(strategy=GenerationType.AUTO),

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread [EMAIL PROTECTED]
You can call em.flush() whenever you want, nobody can prevent that. However, if whenever is a good time to synchronize in-memory persistence context state with the database is another question. An exception would probably indicate that this is not a good time. So no, you don't have any way or

[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.

2007-05-11 Thread rhinosystemsinc
Thanks for the info on the sequence - but it still gives me the same problem: 12:15:22,362 ERROR [URLDeploymentScanner] Incomplete Deployment listing: --- MBeans waiting for other MBeans --- ObjectName: persistence.units:ear=naturalmed2.ear,unitName=naturalmed2 State: FAILED Reason: