Mail Archive Home | exoplatform List | Febuary 2007 Index
| <-- Date Index --> | <-- Thread Index --> |
Hello,
I try to use hibernate and postgresql with exoplatform. I have
created a table called
t_contact and a file Contact.java. I want to store data in my table.
I have created two files hibernate.cfg.xml and Annuaire.hbm.xml
when i add:
<mapping resource="Annuaire.hbm.xml" />
in my file hibernate.cfg.xml
the execution ends here:
[INFO] Creation de SessionFactory dans la classe HibernateUtil
[INFO] Nouvelle configuration creee dans la classe HibernateUtil
[INFO] Configuration - configuring from resource: /hibernate.cfg.xml
[INFO] Configuration - Configuration resource: /hibernate.cfg.xml
[INFO] Configuration - Reading mappings from resource: Annuaire.hbm.xml
[INFO] HbmBinder - Mapping class: org.objectweb.lomboz.sample.Contact ->
t_cont
ct
[INFO] Configuration - Configured SessionFactory: null
[INFO] La configuration est prete
[INFO] C3P0ConnectionProvider - C3P0 using driver: org.postgresql.Driver at
URL
jdbc:postgresql://localhost:5432/BaseAnnuaire
[INFO] C3P0ConnectionProvider - Connection properties: {user=postgres,
password
****, autocommit=true}
[INFO] C3P0ConnectionProvider - autocommit mode: true
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@16fa38
[ con
ectionPoolDataSource ->
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@172
614 [ acquireIncrement -> 1, autoCommitOnClose -> false,
connectionTesterClassN
me -> com.mchange.v2.c3p0.impl.DefaultConnectionTester,
factoryClassLocation ->
null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod
-> 0
initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20,
maxStatements ->
50, minPoolSize -> 5, nestedDataSource ->
com.mchange.v2.c3p0.DriverManagerData
ource@859367 [ description -> null, driverClass -> null,
factoryClassLocation -
null, jdbcUrl -> jdbc:postgresql://localhost:5432/BaseAnnuaire, properties
->
user=postgres, password=pass, autocommit=true} ] , propertyCycle -> 300,
testCo
nectionOnCheckout -> false ] , factoryClassLocation -> null,
numHelperThreads -
3 ]
[INFO] SettingsFactory - RDBMS: PostgreSQL, version: 8.2.3
[INFO] SettingsFactory - JDBC driver: PostgreSQL Native Driver, version:
Postgr
SQL 8.2 JDBC2 Enterprise with NO SSL (build 504)
[INFO] Dialect - Using dialect: org.hibernate.dialect.PostgreSQLDialect
[INFO] TransactionFactoryFactory - Using default transaction strategy
(direct J
BC transactions)
[INFO] TransactionManagerLookupFactory - No TransactionManagerLookup
configured
(in JTA environment, use of read-write or transactional second-level cache
is n
t recommended)
[INFO] SettingsFactory - Automatic flush during beforeCompletion():
disabled
[INFO] SettingsFactory - Automatic session close at end of transaction:
disable
[INFO] SettingsFactory - JDBC batch size: 15
[INFO] SettingsFactory - JDBC batch updates for versioned data: disabled
[INFO] SettingsFactory - Scrollable result sets: enabled
[INFO] SettingsFactory - JDBC3 getGeneratedKeys(): disabled
[INFO] SettingsFactory - Connection release mode: auto
[INFO] SettingsFactory - Default batch fetch size: 1
[INFO] SettingsFactory - Generate SQL with comments: disabled
[INFO] SettingsFactory - Order SQL updates by primary key: disabled
[INFO] SettingsFactory - Query translator:
org.hibernate.hql.ast.ASTQueryTransl
torFactory
[INFO] ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[INFO] SettingsFactory - Query language substitutions: {}
[INFO] SettingsFactory - Second-level cache: enabled
[INFO] SettingsFactory - Query cache: disabled
[INFO] SettingsFactory - Cache provider:
org.hibernate.cache.NoCacheProvider
[INFO] SettingsFactory - Optimize cache for minimal puts: disabled
[INFO] SettingsFactory - Structured second-level cache entries: disabled
[INFO] SettingsFactory - Statistics: disabled
[INFO] SettingsFactory - Deleted entity synthetic identifier rollback:
disabled
[INFO] SettingsFactory - Default entity-mode: pojo
[INFO] SessionFactoryImpl - building session factory
The file Annuaire.hbm.xml is:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.objectweb.lomboz.sample">
<class name="Contact" table="t_contact">
<id name="Id" type="integer">
<column name="id" sql-type="int"/>
<generator class="native" />
</id>
<property name="lastName" type="string">
<column name="lastname" sql-type="char(50)" not-null="true"/>
</property>
<property name="firstName" type="string">
<column name="firstname" sql-type="char(50)" not-null="true"/>
</property>
<property name="numTel" type="integer">
<column name="telephone" sql-type="int" not-null="false"/>
</property>
</class>
</hibernate-mapping>
The hibernate.cfg.xml file is:
<?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.show_sql">false</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</
property>
<property name="hibernate.connection.url">
jdbc:postgresql://localhost:5432/BaseAnnuaire</property>
<property name="hibernate.connection.driver_class">
org.postgresql.Driver</property>
<property name="hibernate.connection.autocommit">true</property>
<property name="hibernate.connection.username"> postgres</property>
<property name="hibernate.connection.password"> pass</property>
<property name="hibernate.dialect">
org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.c3p0.min_size"> 5</property>
<property name="hibernate.c3p0.max_size"> 20</property>
<property name="hibernate.c3p0.timeout"> 1800</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.NoCacheProvider</property>
<mapping resource="Annuaire.hbm.xml" />
</session-factory>
</hibernate-configuration>
How may i know where is the problem among the two files?
Thank you.
Mickael Lecoq
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.