Hello Hibernate guru's
First post, so let me Introduce myself. I have been a Java Programmer since a bunch of years.
The last years I have mostly worked for companies which had a JSP framework without Hibernate.
Using JDBC directly.
Long ago I worked with Torque which is also a Persistence Layer.
Now for my Question:
At the moment I am working in a Large Oracle 11g Clustered DB. This DB has some "funny" Quirks.
I have a configuration using Hibernate 4.1. I also plan on using JPA, Spring 3.1.2
Made a persistence.xml and a hibenate.cfg.xml, both are configured.
I can connect to the DB via this connection. All works fine if I write my own DTO, DAO. for a certain table.
However the DB I am trying to generate the classes or even approach the DB via "Hibernate Console Configuration" in Eclipse I stumble over a table which has 2 columns one with the name "
bsINin" and one "
bsinin" . So case sensitive a different name.
Renaming the Column is NO option. I would have never chosen to have 2 columns in the same table with names like this but however I am stuck with it for now.
I have looked around in this Forum and others but don't find a way to configure this. I also thought about the option of excluding certain tables which pose a problem. The thing there is when I am trying to open the "Hibernate Console Configuration" with the "hibernate.cfg.xml" I made
(Eclipse 3.7.2 and plugin "Hibernate Tools") I get the error below. My understanding is that I have to exclude tables in the reveng file and not in the hibenate.cfg.xml.
"bsINin" and one "bsinin"Oracle create Table Code:
CREATE TABLE "MYDBUSER"."myeditedtablename" (
"aobedr" NUMBER(14,2),
"bsINin" NUMBER(4,0) NOT NULL ENABLE,
"aoperc" NUMBER(4,2),
"bsinin" NUMBER(1,0),
"grbknr" NUMBER(8,0),
"oms" VARCHAR2(30 CHAR))
Code:
org.hibernate.cfg.JDBCBinderException: org.hibernate.mapping.Column(bsinin) already exists in MYDBUSER.myeditedtablename
at org.hibernate.cfg.reveng.JDBCReader.processBasicColumns(JDBCReader.java:626)
at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:85)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:126)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:115)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:65)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
This link has a nice diagram of the approach I am planing to use:
http://thecafetechno.com/tutorials/hibernate/hibernate-and-java-persistence-apijpa/
Does anyone have any suggestions of what I might configure or change so I can either just generate classes with case sensitive column names... which would solve my issue, or exclude a bunch of tables from being read from the schema upon approaching via "Hibernate Console Configuration".
Any help is much appreciated.
Kind regards
Marco Schoolenberg