-->
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.  [ 2 posts ] 
Author Message
 Post subject: defaultdatabase_tablename not working..
PostPosted: Wed Nov 02, 2005 5:41 am 
Newbie

Joined: Wed Nov 02, 2005 5:33 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3

Mapping documents:LocGpsRecord.hbm.xml

Code between sessionFactory.openSession() and session.close():
tx = session.beginTransaction();

// [laliluna] create a new object
LocGpsRecord honey = new LocGpsRecord();
honey.setX("x");
honey.setY("y");
honey.setV("v");
honey.setA("a");
honey.setEndDeviceId("end");
honey.setD("d");
honey.setT(new Date());
honey.setTAdapter(new Date());
honey.setTCreated(new Date());
//honey.setTaste("sweet");

// [laliluna] save it to the database, Hibernate returns your object
// with the primary key field updated!
id = (Integer) session.save(honey);

tx.commit();

Full stack trace of any exception that occurs:
could not insert: [filomas.device.LocGpsRecord]

Name and version of the database you are using:
MySQL 4.0
The generated SQL (show_sql=true):
Hibernate: /* insert filomas.device.LocGpsRecord */ insert into filomdb_loc_gps_record (end_device_id, t, x, y, v, a, d, t_adapter, t_created) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

Debug level Hibernate log excerpt:


Hi everybody,
Why does the sql generated has filomdb_loc_gps_record instead of filomdb.loc_gps_record? (the one I guess would be working?)

What do I miss as configuration?

Thanks in advance,
Ferhat Akcin
Erk IT


Top
 Profile  
 
 Post subject: Found the problem
PostPosted: Wed Nov 02, 2005 6:11 am 
Newbie

Joined: Wed Nov 02, 2005 5:33 am
Posts: 2
<property name="hibernate.default_schema">filomdb</property>

is not needed in the hibernate configuration file when

<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/filomdb</property>

is used.

isnt that strange anyhow..

Ferhat Akcin
Erk IT


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.