-->
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: Case sensitive column names
PostPosted: Thu Sep 06, 2012 4:11 am 
Newbie

Joined: Wed Sep 05, 2012 10:52 am
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Case sensitive column names
PostPosted: Mon Sep 24, 2012 11:26 am 
Newbie

Joined: Wed Sep 05, 2012 10:52 am
Posts: 2
Does anyone read this forum or is it just for spammers ??


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.