-->
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.  [ 1 post ] 
Author Message
 Post subject: Reverse engineer from MySQL InnoDB catalog attribute
PostPosted: Sun Jun 27, 2010 3:26 pm 
Newbie

Joined: Sun Jun 27, 2010 1:45 pm
Posts: 4
Hi,

I am new to hibernate and eclipse hibernate tools. I am reverse ingineering an InnoDB MySQL database and the created Java entities include @Table annotation with an attribute catalog.

Code:
@Entity
@Table(name = "my_table", catalog = "my_catalog")
public class MyTable implements java.io.Serializable {
...
}

Running with such entity classes results in:

Code:
Hibernate:
    insert
    into
        my_db.my_catalog.my_table
        (column1, column2)
    values
        (?, ?)


which throws:

Code:
[WARN] util.JDBCExceptionReporter SQL Error: 1064, SQLState: 42000
[ERROR] util.JDBCExceptionReporter You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.my_table (column1, column2) values ('aaaaaaaaaaaaaaaaaaaa' at line 1


If I remove catalog attribute from @Table the insert statement looks like:
Code:
Hibernate:
    insert
    into
        my_db.my_table
        (column1, column2)
    values
        (?, ?)


and it succeeds.

Of course I do not want to manualy remove this attribute each time I generate entity classes. How do I prevent this attribute to appear in my source code in the first place?

Thanks for any info in advance,
Borut


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

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.