Fernando_Generoso_da 4 de mar. de 2012
Não…JPA é uma especificação, e não uma implementação. Além do Hibernate, que é um framework de persistência de dados E implementação da ESPECIFICAÇÃO JPA, tu pode utilizar outras implementações, como as implementações de referência, que para o JPA 1 é o toplink e para o JPA 2 é o EclipseLink.
Fernando
Fernando_Generoso_da 5 de mar. de 2012
Sim, Tu pode utilizar JPA com a implementação do hibernate, ou apenas utilizar o framework hibernate. Com a segunda opção, tu nao teria mais compatibilidade, e não poderia trocar , sem ter algum esforço, a tua implementação.
Fernando
Miltex 13 de abr. de 2012
Beleza ??? Velho !!!
Estou com essa mesma duvida …
Estou trabalhando em um projeto com GWT e Hibernate como a implementação da especificação JPA…
Neste caso eu tenho que configurar o persistence.xml ???
Quando utilizo o Hibernete com JPA não preciso do arquivo de config. hibernate.cfg.xml :?: é isso msm ???
A seguinte exceção está sendo lançada…
13 / 04 / 2012 17 : 09 : 12 or g . hibernate . annotations . common . Version < clinit >
INFO : HCANN000001 : Hibernate Commons Annotations { 4.0.1. Final }
13 / 04 / 2012 17 : 09 : 12 or g . hibernate . Version log Version
INFO : HHH000412 : Hibernate Core { 4.0.0. Final }
13 / 04 / 2012 17 : 09 : 12 or g . hibernate . cfg . Environment < clinit >
INFO : HHH000206 : hibernate . properties not found
13 / 04 / 2012 17 : 09 : 12 or g . hibernate . cfg . Environment buildBytecodeProvider
INFO : HHH000021 : Bytecode provider name : javassist
13 / 04 / 2012 17 : 09 : 14 or g . hibernate . service . jdbc . connections . int ernal . DriverManagerConnectionProviderImpl configure
INFO : HHH000402 : Using Hibernate built - in connection pool ( not for production use ! )
13 / 04 / 2012 17 : 09 : 14 or g . hibernate . service . jdbc . connections . int ernal . DriverManagerConnectionProviderImpl configure
INFO : HHH000115 : Hibernate connection pool size : 20
13 / 04 / 2012 17 : 09 : 14 or g . hibernate . service . jdbc . connections . int ernal . DriverManagerConnectionProviderImpl configure
INFO : HHH000006 : Autocommit mode : true
13 / 04 / 2012 17 : 09 : 14 or g . hibernate . service . jdbc . connections . int ernal . DriverManagerConnectionProviderImpl configure
INFO : HHH000401 : using driver [ com . mysql . jdbc . Driver ] at URL [ jdbc : mysql : // localhost : 3306 / petshop ]
13 / 04 / 2012 17 : 09 : 14 or g . hibernate . service . jdbc . connections . int ernal . DriverManagerConnectionProviderImpl configure
INFO : HHH000046 : Connection properties : { user = root , password =**** , autocommit = true , release_mode = auto }
13 / 04 / 2012 17 : 09 : 15 or g . hibernate . dialect . Dialect < init >
INFO : HHH000400 : Using dialect : or g . hibernate . dialect . MySQLDialect
13 / 04 / 2012 17 : 09 : 15 or g . hibernate . engine . jdbc . int ernal . LobCreatorBuilder useContextualLobCreation
INFO : HHH000423 : Disabling cont extual LOB creation as JDBC driver reported JDBC version [ 3 ] less than 4
13 / 04 / 2012 17 : 09 : 15 or g . hibernate . engine . transaction . int ernal . TransactionFactoryInitiator initiateService
INFO : HHH000268 : Transaction strategy : or g . hibernate . engine . transaction . int ernal . jdbc . JdbcTransactionFactory
13 / 04 / 2012 17 : 09 : 15 or g . hibernate . hql . int ernal . ast . ASTQueryTranslatorFactory < init >
INFO : HHH000397 : Using ASTQueryTranslatorFactory
A criacao inicial do SessionFactory falhou !
javax . persistence . PersistenceException : [ PersistenceUnit : ProjectJPAGWT ] Unable to build EntityManagerFactory
at or g . hibernate . ejb . Ejb3Configuration . buildEntityManagerFactory ( Ejb3Configuration . java : 914 )
at or g . hibernate . ejb . Ejb3Configuration . buildEntityManagerFactory ( Ejb3Configuration . java : 890 )
at or g . hibernate . ejb . HibernatePersistence . createEntityManagerFactory ( HibernatePersistence . java : 56 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 63 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 47 )
at br . milton . shared . model . JpaFactory . < clinit > ( JpaFactory . java : 21 )
at br . milton . server . ServicoCrudBdImpl . getList a ( ServicoCrudBdImpl . java : 34 )
at br . milton . server . ServicoCrudBdImpl . main ( ServicoCrudBdImpl . java : 44 )
Caused by : or g . hibernate . HibernateException : Error applying BeanValidation relational constraints
at or g . hibernate . cfg . beanvalidation . BeanValidationIntegrator . applyRelationalConstraints ( BeanValidationIntegrator . java : 219 )
at or g . hibernate . cfg . beanvalidation . BeanValidationIntegrator . int egrate ( BeanValidationIntegrator . java : 126 )
at or g . hibernate . int ernal . SessionFactoryImpl . < init > ( SessionFactoryImpl . java : 295 )
at or g . hibernate . cfg . Configuration . buildSessionFactory ( Configuration . java : 1737 )
at or g . hibernate . ejb . EntityManagerFactoryImpl . < init > ( EntityManagerFactoryImpl . java : 76 )
at or g . hibernate . ejb . Ejb3Configuration . buildEntityManagerFactory ( Ejb3Configuration . java : 905 )
... 7 more
Caused by : java . lang . reflect . InvocationTargetException
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 57 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 43 )
at java . lang . reflect . Method . invoke ( Method . java : 616 )
at or g . hibernate . cfg . beanvalidation . BeanValidationIntegrator . applyRelationalConstraints ( BeanValidationIntegrator . java : 208 )
... 12 more
Caused by : or g . hibernate . HibernateException : Unable to build the def ault Val idatorFactory
at or g . hibernate . cfg . beanvalidation . TypeSafeActivator . get Val idatorFactory ( TypeSafeActivator . java : 524 )
at or g . hibernate . cfg . beanvalidation . TypeSafeActivator . applyDDL ( TypeSafeActivator . java : 119 )
... 17 more
Caused by : javax . val idation . Val idationException : Unable to find a def ault provider
at javax . val idation . Val idation$GenericBootstrapImpl . configure ( Val idation . java : 264 )
at javax . val idation . Val idation . buildDefaultValidatorFactory ( Val idation . java : 111 )
at or g . hibernate . cfg . beanvalidation . TypeSafeActivator . get Val idatorFactory ( TypeSafeActivator . java : 521 )
... 18 more
Exception in thread "main" java . lang . ExceptionInInitializerError
at br . milton . shared . model . JpaFactory . < clinit > ( JpaFactory . java : 26 )
at br . milton . server . ServicoCrudBdImpl . getList a ( ServicoCrudBdImpl . java : 34 )
at br . milton . server . ServicoCrudBdImpl . main ( ServicoCrudBdImpl . java : 44 )
Caused by : javax . persistence . PersistenceException : [ PersistenceUnit : ProjectJPAGWT ] Unable to build EntityManagerFactory
at or g . hibernate . ejb . Ejb3Configuration . buildEntityManagerFactory ( Ejb3Configuration . java : 914 )
at or g . hibernate . ejb . Ejb3Configuration . buildEntityManagerFactory ( Ejb3Configuration . java : 890 )
at or g . hibernate . ejb . HibernatePersistence . createEntityManagerFactory ( HibernatePersistence . java : 56 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 63 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 47 )
at br . milton . shared . model . JpaFactory . < clinit > ( JpaFactory . java : 21 )
... 2 more
Caused by : or g . hibernate . HibernateException : Error applying BeanValidation relational constraints
at or g . hibernate . cfg . beanvalidation . BeanValidationIntegrator . applyRelationalConstraints ( BeanValidationIntegrator . java : 219 )
at or g . hibernate . cfg . beanvalidation . BeanValidationIntegrator . int egrate ( BeanValidationIntegrator . java : 126 )
at or g . hibernate . int ernal . SessionFactoryImpl . < init > ( SessionFactoryImpl . java : 295 )
at or g . hibernate . cfg . Configuration . buildSessionFactory ( Configuration . java : 1737 )
at or g . hibernate . ejb . EntityManagerFactoryImpl . < init > ( EntityManagerFactoryImpl . java : 76 )
at or g . hibernate . ejb . Ejb3Configuration . buildEntityManagerFactory ( Ejb3Configuration . java : 905 )
... 7 more
Caused by : java . lang . reflect . InvocationTargetException
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl . java : 57 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 43 )
at java . lang . reflect . Method . invoke ( Method . java : 616 )
at or g . hibernate . cfg . beanvalidation . BeanValidationIntegrator . applyRelationalConstraints ( BeanValidationIntegrator . java : 208 )
... 12 more
Caused by : or g . hibernate . HibernateException : Unable to build the def ault Val idatorFactory
at or g . hibernate . cfg . beanvalidation . TypeSafeActivator . get Val idatorFactory ( TypeSafeActivator . java : 524 )
at or g . hibernate . cfg . beanvalidation . TypeSafeActivator . applyDDL ( TypeSafeActivator . java : 119 )
... 17 more
Caused by : javax . val idation . Val idationException : Unable to find a def ault provider
at javax . val idation . Val idation$GenericBootstrapImpl . configure ( Val idation . java : 264 )
at javax . val idation . Val idation . buildDefaultValidatorFactory ( Val idation . java : 111 )
at or g . hibernate . cfg . beanvalidation . TypeSafeActivator . get Val idatorFactory ( TypeSafeActivator . java : 521 )
... 18 more
Alguém já se deparou com esse problema ???
Da um help aí moçada . . .
Valew !!!
:roll: