[JBoss-user] [EJB 3.0] - Re: EJB3 Entity Primary Key Retrieval

2006-03-28 Thread wargun02
Thanks Marcio,

This is a cool solution, it worked! Tested and verified. Thanks again.


Regards,

Max Lam

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3933254#3933254

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3933254


---
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=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Eclipse IDE (users)] - Re: EJB3 @Column(primaryKey = true) problem

2006-03-27 Thread wargun02
Try this:

@Id
@Column(name = xxx, nullable = false, updateable = false, insertable = false)

The @Id annotation type is to indicate that the column/field is a primary key.


Max Lam

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3933022#3933022

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3933022


---
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=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - EJB3 Entity Primary Key Retrieval

2006-03-27 Thread wargun02
Hi,

I have a problem with retrieving the primary key of an entity object after 
persisting. My case is:

:- I have an entity object which has the id as the primary key field of type 
long and the value is auto generated by the database (and with all necessary 
annotations assigned)
:- After I invoke the EntityManager em to persist my entity (e.g. 
em.persist(entityObj) ), I want to know what was the newly assigned primary key 
by the database.

So, is there any way to retrieve the newly assigned primary key of the entity, 
since the EntityManager.persist() method returns nothing (void)?

Any suggestion will be greatly appreciated. Thank you.


Max Lam

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3933024#3933024

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3933024


---
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=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: EJB3 Session Bean (Bean Managed Transaction) issue

2006-03-19 Thread wargun02
Hi aakashvj,

Thanks for the reply. You've got a great working post here.

I think I still need to be more firmiliar with the annotation thingy...

Thank you.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3931253#3931253

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3931253


---
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=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - EJB3 Session Bean (Bean Managed Transaction) issue

2006-03-18 Thread wargun02
Hi,

I have a problem with getting bean managed transaction or more appropriately 
user managed transaction to work on my Session Bean (EJB3 specs.)

I have a session bean with the EntityManager em already defined and I have a 
method xxx() which is suppose to rollback all which persistence when one of 
them failed.

I tried to obtain the EntityTransaction by calling:

EntityTransaction trxn = em.getTransaction();

try
{
trxn.begin();
//do something...
trxn.commit();
}
catch(Exception ex)
{
trxn.rollback();
}

Unfortunately, JBoss throws IllegalStateException while calling 
em.getTransaction(). May I know how do I configure the session bean to be able 
to handle user managed transaction instead of container managed transaction 
(like the old days where we could define that in the ejb-jar.xml)? I'm running 
on JBoss 4.0.4RC1.

Any help will be greatly appreciated. Thank you.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3931192#3931192

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3931192


---
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=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user