-->
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.  [ 3 posts ] 
Author Message
 Post subject: how to suppress connection info in generated hib...cfg.xml
PostPosted: Mon Mar 03, 2008 8:40 am 
Newbie

Joined: Fri Feb 29, 2008 6:04 pm
Posts: 2
Hibernate version: Hibernate Tools Plugin for Eclipse (3.2.0GA.)

Name and version of the database you are using: Oracle 10j

We're using the latest Hibernate Tools Plugin for Eclipse (3.2.0GA.) and we're reverse engineering our hibernate.cfg.xml file, unfortunately, the generated file contains the following settings that we need to suppress:

Code:
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">shhhhhh</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@server.domain.com:1542:SID</property>
<property name="hibernate.connection.username">my_schema</property>
<property name="hibernate.default_schema">my_schema</property>


We reverse-engineer out of our DEV environment so we need to put these in the hibernate.cfg.xml file used during the reverse-engineering process but we don't want them in the final file because we use a Data Source in our J2EE container at run-time and because these connection information represents a security risk.

Note that the connection information is undesirable but at least it's not used. The hibernate.default_schema, however is actually causing us a problem and I've needed to pop it out of the file using Ant at build-time; something I _really_ don't want to do long term.


Thanks for any insight,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 04, 2008 11:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
then dont use a <jdbcconfiguration> to generate cfg.xml

Use a proper setup <configuration> with hbm.xml fileset to define the classmappings.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: how to suppress connection info in generated hib...cfg.xml
PostPosted: Wed Mar 05, 2008 12:14 pm 
Newbie

Joined: Fri Feb 29, 2008 6:04 pm
Posts: 2
Max, thanks for the reply but I'm going to need an example to understand. I've searched on <jdbcconfiguration> and <configuration> and they appear to be related to Ant but we're using the Eclipse plugin... (I'm kinda taking over for others here so I'm a bit at a loss, so any details would be greatly appreciated)

Here's the source hibernate.cfg.xml file which we use with a long file named domain.reveng.xml. Together they generate the runtime files, perhaps you could tell me how to modify it?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.password">x</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@x:y:z</property>
        <property name="hibernate.connection.username">x</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
        <property name="hibernate.default_schema">x</property>
    </session-factory>
</hibernate-configuration>


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