• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

sample hibernate configartion files...

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hibernate.cfg.xml

<!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="show_sql">true</property>
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>

<property name="connection.url">jdbc:sqlserver://16.123.123.105:1433;SelectMethod=cursor;databaseName=XXXX</property>
<property name="connection.username">un</property>
<property name="connection.password">pw</property>


<property name="hibernate.connection.autocommit">false</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.default_schema">dbo</property>
<property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="transaction.flush_before_completion">true</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>



</session-factory>
</hibernate-configuration>

hibernate.reveng.xml
<?xml version='1.0' encoding='UTF-8'?>
****************************************************************
-->
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>

<type-mapping>
<!-- jdbc-type is name fom java.sql.Types -->
<sql-type jdbc-type="CHAR" hibernate-type="java.lang.String" />
<sql-type jdbc-type="VARCHAR" hibernate-type="java.lang.String" />
<sql-type jdbc-type="BIT" hibernate-type="java.lang.Boolean" />
<sql-type jdbc-type="TINYINT" hibernate-type="java.lang.Short" />
<sql-type jdbc-type="SMALLINT" hibernate-type="java.lang.Short" />
<sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Integer" />
<sql-type jdbc-type="BIGINT" hibernate-type="java.lang.Long" />
<sql-type jdbc-type="DOUBLE" hibernate-type="java.lang.Double" />
<sql-type jdbc-type="FLOAT" hibernate-type="java.lang.Double" />
<sql-type jdbc-type="DECIMAL" hibernate-type="java.lang.Long" />
<sql-type jdbc-type="NUMERIC" hibernate-type="java.lang.Long" />
<sql-type jdbc-type="TIMESTAMP" hibernate-type="java.sql.Timestamp" />
<sql-type jdbc-type="TIME" hibernate-type="java.sql.Time" />
<sql-type jdbc-type="DATE" hibernate-type="java.util.Date" />

</type-mapping>

<table-filter match-name="USERS" match-schema="dbo" />

</hibernate-reverse-engineering>

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic