Sequence and dataobjects error

[email protected]
Newsgroups gmane.comp.java.ejb.middlegen.user
Message-ID <[email protected]>
Hi all,

I've generated some entity EJBs with middlegen software. I've set "dataobject=true" and included the "sequenceblock" in the "cmp20" task.

The problem appears when I try to make a create over the entity EJB with the generated dataobject. Because the setData function neither uses the Sequence EJB to get the following ID for the EJB, nor reads the ID from the dataobject, an SQL exception rises:
  Fail to add null value in not null attribute ID
because the ID is null (and it's the primary key).

There's no problem if I create the entity passing the parameters instead of passing the dataobject.

Is there any solution?. Do I have to include the PK generation in every create method if I want to create with the dataobject?

Thanks,
Jorge

__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.