-
1. Re: MySQL CMP and auto-increment
viz Jul 19, 2003 5:22 AM (in response to alpine)auto_increment does work as I have it working on two tables and with CMR!
Your jbosscmp-jdbc.xml looks fine.
I can give you a working setup?
Kind regards,
--
Marc -
2. Re: MySQL CMP and auto-increment
alpine Jul 19, 2003 6:15 AM (in response to alpine)Viz,
Yes, please do. Thanks! -
3. Re: MySQL CMP and auto-increment
alpine Jul 20, 2003 6:16 AM (in response to alpine)I discovered these examples which have helped greatly:
http://www.oreilly.com/catalog/entjbeans3/workbooks/
and managed to get the autoincrement to work. I do have one question: I am unable to get the auto generated primary key. I noticed that you need to put a getGeneratedPrimaryKey method into the code, but no matter what I do I seem to get a null pointer message.
Does anyone know where to insert the getGeneratedPrimaryKey() method in order to get it to work? I put references to it into my Bean and Remote classes but I always get a null pointer exception. Thanks. -
4. Re: MySQL CMP and auto-increment
viz Jul 21, 2003 12:10 PM (in response to alpine)"Viz" wrote:
Here is a setup that works for me. -
5. Re: MySQL CMP and auto-increment
viz Jul 21, 2003 12:13 PM (in response to alpine)You do not need to do anything in the code if you use a similar setup to the one I have posted.
I struggled to get this to work and there is a lot of confusing info out there. I have been meaning to put a little document together to spell it out simply, but time has evaded me :-)
Kind regards,
--
Marc -
6. Re: MySQL CMP and auto-increment
viz Jul 21, 2003 12:15 PM (in response to alpine)Also, if you need the java file I can let you have these also - I didn't include them as I did not want to appear as if I was teaching my Grandmother to suck eggs :-)
Kind regards,
--
Marc -
7. Re: MySQL CMP and auto-increment
xavierpayne2 Aug 13, 2003 7:44 PM (in response to alpine)if you are still watching this thread... please do post your .java.
I have the descriptors looking good but still don't know what the create and postcreate for my bean is supposed to look like. I tried them args and I just get null pointer exceptions. -
8. Re: MySQL CMP and auto-increment
fredatwork Sep 3, 2003 4:15 AM (in response to alpine)Hello,
Could you please let me know how did you solve the problem. I have exactly the same one and the <auto-increment/> tag is not accepted.
I checked the EJB samples you mention, but I dod not find any reference to <auto-increment/>.
Thanks in advance for you tip.
PS: I run JBoss 3.2 and MySQL 3.23.