• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

not-null & auto-increment

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

this might be a really stupid question since I'm new to java EE. I'm trying to make a database table with entity bean: CREATE TABLE XXX { ID int not null auto-increment primary key, name varchar(255)};

So i have declared with xdoclet
* @ejb.pk-field
* @ejb.persistent-field column-name="ID"
* @ejb.interface-method view-type="local"
* @jboss.persistence auto-increment = "true"
* not-null = "true"

In ejb-jar the ID field has been declared primary key.
In jbosscmp-jdbc.xml the ID cmp field have been declared "not-null" and "auto-increment".

I'm using mySQL with I have changed in standardjbosscmp-jdbc.xml and I have declared
* @jboss.entity-command name="mysql-get-generated-keys"
In the entity bean


BUT still after deployment... when I type "show create table XXX" in my MySQL shell.... neither "not null" nor "auto-increment" is declared!

Any suggestions of what can be wrong?

Everything works fine if i manually create the SQL-table with "not null" and "auto-increment". Its really confusing.
 
reply
    Bookmark Topic Watch Topic
  • New Topic