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