-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: mysql, jboss, what id generator for AUTO_INCREMENT fields
PostPosted: Tue Apr 20, 2004 3:33 pm 
Newbie

Joined: Mon Feb 16, 2004 11:28 pm
Posts: 16
Ive RTFM'd and still cannot determine what to put in the generator attribute of the id tag. Ive been getting "The user must supply a JDBC connection" errors. Basically, hibernate can submit a null id to mysql and mysql will shove in the appropriate value. Anyone know how to configure this?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 4:58 pm 
Newbie

Joined: Tue Nov 04, 2003 7:31 pm
Posts: 5
for MySQL auto-increment fields use 'native' as the generator. (5.1.4.1 in the docs)

The error you mentioned sounds like a data source configuration issue.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 21, 2004 8:30 am 
Newbie

Joined: Mon Feb 16, 2004 11:28 pm
Posts: 16
If I put the same JNDI name for the datasource in hibernate.properties it works. When I swap the hibernate.cfg.xml for hibernate.properties, I get this error. Maybe Im not specifying enough in the cfg file. Here is what I have.

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:/QQQAdminDB</property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>

<!-- Mapping files -->
<mapping resource="Team.hbm.xml"/>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.