Rechercher : dans
Par :

Problème Hibernate création automatique BDD

Dernière réponse le 19 mar 2009 à 12:36:49 Louevie, le 4 fév 2009 à 12:01:54 
 Signaler ce message aux modérateurs

Bonjour,


J'utilise actuellement hibernate 3 et je voulais générer automatique ma base de donnée à partir des annotations que j'ai déposé dans une classe Java (par exemple la classe Adresse).

Hors voici le log qui apparait indiquant que le schema de la base a bien été exporté, sauf que lorsque je regarde ma base de donnée avec pgAdmin, ma base de donnée est toujours vide, aucune table n'a été créée ???

11:55:03,668 INFO Version:15 - Hibernate Annotations 3.4.0.GA
11:55:03,684 INFO Environment:543 - Hibernate 3.3.1.GA
11:55:03,684 INFO Environment:561 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.postgresql.Driver, hibernate.connexion.pool_size=1, hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, hibernate.connection.username=postgres, hibernate.hbm2ddl.auto=create, hibernate.connection.url=jdbc:postgresql:MaBDD, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, hibernate.connection.password=****}
11:55:03,684 INFO Environment:709 - Bytecode provider name : javassist
11:55:03,684 INFO Environment:627 - using JDK 1.4 java.sql.Timestamp handling
11:55:03,715 INFO Version:14 - Hibernate Commons Annotations 3.1.0.GA
11:55:03,730 INFO HibernateSearchEventListenerRegister:53 - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
11:55:03,762 INFO AnnotationConfiguration:369 - Hibernate Validator not found: ignoring
11:55:03,762 INFO DriverManagerConnectionProvider:64 - Using Hibernate built-in connection pool (not for production use!)
11:55:03,762 INFO DriverManagerConnectionProvider:65 - Hibernate connection pool size: 20
11:55:03,762 INFO DriverManagerConnectionProvider:68 - autocommit mode: false
11:55:03,762 INFO DriverManagerConnectionProvider:103 - using driver: org.postgresql.Driver at URL: jdbc:postgresql:MaBDD
11:55:03,762 INFO DriverManagerConnectionProvider:109 - connection properties: {user=postgres, password=****}
11:55:03,840 INFO SettingsFactory:116 - RDBMS: PostgreSQL, version: 8.3.5
11:55:03,840 INFO SettingsFactory:117 - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC3 with SSL (build 604)
11:55:03,840 INFO Dialect:175 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
11:55:03,871 INFO TransactionFactoryFactory:59 - Using default transaction strategy (direct JDBC transactions)
11:55:03,871 INFO TransactionManagerLookupFactory:80 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
11:55:03,871 INFO SettingsFactory:170 - Automatic flush during beforeCompletion(): disabled
11:55:03,871 INFO SettingsFactory:174 - Automatic session close at end of transaction: disabled
11:55:03,871 INFO SettingsFactory:181 - JDBC batch size: 15
11:55:03,871 INFO SettingsFactory:184 - JDBC batch updates for versioned data: disabled
11:55:03,871 INFO SettingsFactory:189 - Scrollable result sets: enabled
11:55:03,871 INFO SettingsFactory:197 - JDBC3 getGeneratedKeys(): disabled
11:55:03,871 INFO SettingsFactory:205 - Connection release mode: auto
11:55:03,871 INFO SettingsFactory:232 - Default batch fetch size: 1
11:55:03,871 INFO SettingsFactory:236 - Generate SQL with comments: disabled
11:55:03,871 INFO SettingsFactory:240 - Order SQL updates by primary key: disabled
11:55:03,871 INFO SettingsFactory:244 - Order SQL inserts for batching: disabled
11:55:03,871 INFO SettingsFactory:420 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
11:55:03,871 INFO ASTQueryTranslatorFactory:47 - Using ASTQueryTranslatorFactory
11:55:03,871 INFO SettingsFactory:252 - Query language substitutions: {}
11:55:03,871 INFO SettingsFactory:257 - JPA-QL strict compliance: disabled
11:55:03,871 INFO SettingsFactory:262 - Second-level cache: enabled
11:55:03,871 INFO SettingsFactory:266 - Query cache: disabled
11:55:03,871 INFO SettingsFactory:405 - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
11:55:03,871 INFO SettingsFactory:276 - Optimize cache for minimal puts: disabled
11:55:03,871 INFO SettingsFactory:285 - Structured second-level cache entries: disabled
11:55:03,871 INFO SettingsFactory:305 - Echoing all SQL to stdout
11:55:03,871 INFO SettingsFactory:314 - Statistics: disabled
11:55:03,871 INFO SettingsFactory:318 - Deleted entity synthetic identifier rollback: disabled
11:55:03,871 INFO SettingsFactory:333 - Default entity-mode: pojo
11:55:03,871 INFO SettingsFactory:337 - Named query checking : enabled
11:55:03,902 INFO SessionFactoryImpl:187 - building session factory
11:55:03,918 INFO SessionFactoryObjectFactory:105 - Not binding factory to JNDI, no JNDI name configured
11:55:03,918 INFO SchemaExport:226 - Running hbm2ddl schema export
11:55:03,918 INFO SchemaExport:251 - exporting generated schema to database
11:55:03,934 INFO SchemaExport:268 - schema export complete

Auriez vous une idée de ce qui pourrait faire que la base de donnée ne se crée pas réellement ??

Configuration: Windows XP
Firefox 3.0.5

Meilleures réponses pour « Problème Hibernate création automatique BDD » dans :
Légende automatique sous Word VoirCréer automatiquement une légende sous Word Personnalisation de la barre d'outils Insertion de l'image Insertion de l'étiquette Insertion de nouvelles étiquettes Le renvoi vers une figure Personnalisation de la barre d'outils Pour...
[Sécurité] Points de restauration intensifiés Voir1. Création des points de restauration 1.1. Automatiquement 1.2. Manuellement 1.2.1 Sous XP 1.2.2. Sous Vista 2. Suppression des points de restauration 2.1. Automatiquement 2.2. Manuellement 2.2.1. Sous XP 2.2.2. Sous Vista À voir...
Mode Administrateur ou Utilisateur sous XP VoirLorsque vous installez le système d’exploitation de Windows, celui-ci, par défaut, crée automatiquement un compte Administrateur. Or, lors de votre installation, on ne trouve nulle part d'explications concernant la différence entre ce compte et un...

1

 serge, le 19 mar 2009 à 12:36:49
  • +1

Votre proprite hbm2dll.auto est sans doute à create-drop. La table est détruite à la fermeture de la sessionFactory
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>

Répondre à serge