Re: [hibernate-dev] Metamodel tests

2012-07-30 Thread Hardy Ferentschik

On Jul 29, 2012, at 10:38 PM, Steve Ebersole wrote:

> Just a reminder that I am on vacation this next week.
> 
> If you want this in the meantime, you just need to alter the 
> org.hibernate.metamodel.spi.relational.Database#generateSchemaCreationScript 
> and 
> org.hibernate.metamodel.spi.relational.Database#generateDropSchemaScript 
> methods.   There is a 
> org.hibernate.metamodel.spi.relational.Schema#sequences collection, but 
> they wont be populated using this 
> generateSchemaCreationScript/generateDropSchemaScript approach, so in 
> there you will need a way to find all persistent identifier generators 
> (please DO NOT collect them on Database/Schema) and handle it.

Nice. Sounds good. I like how the new model is shaping up.

--hardy


___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] Metamodel tests

2012-07-30 Thread Hardy Ferentschik

On Jul 29, 2012, at 10:47 PM, Steve Ebersole wrote:

> Nonetheless, returning null instead of empty string is the convention we 
> decided on in Austin.  It just does not make sense to keep doing that 
> isEmpty() style checks higher and higher.

+1 



___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] hbm mapping exception

2012-07-30 Thread Strong Liu
hibernate envers test 
_org.hibernate.envers.test.integration.components.PropertiesGroupTest_ is 
failing with the following exception, but I don't see there is a mapping xml 
issue, could someone take a look?



21:07:04,514  INFO Environment:342 - HHH21: Bytecode provider name : 
javassist
21:07:04,534  INFO Dialect:125 - HHH000400: Using dialect: 
org.hibernate.dialect.H2Dialect
21:07:04,719  INFO Dialect:125 - HHH000400: Using dialect: 
org.hibernate.dialect.H2Dialect
21:07:04,857  INFO Version:37 - HCANN01: Hibernate Commons Annotations 
{4.0.1.Final}
Before class callback errror : 
org.hibernate.testing.junit4.BaseCoreFunctionalTestCase#buildSessionFactory
org.hibernate.testing.junit4.CallbackException: 
org.hibernate.testing.junit4.BaseCoreFunctionalTestCase#buildSessionFactory
at 
org.hibernate.testing.junit4.TestClassMetadata.invokeCallback(TestClassMetadata.java:199)
at 
org.hibernate.testing.junit4.TestClassMetadata.performCallbacks(TestClassMetadata.java:190)
at 
org.hibernate.testing.junit4.TestClassMetadata.performBeforeClassCallbacks(TestClassMetadata.java:181)
at 
org.hibernate.testing.junit4.BeforeClassCallbackHandler.evaluate(BeforeClassCallbackHandler.java:43)
at 
org.hibernate.testing.junit4.AfterClassCallbackHandler.evaluate(AfterClassCallbackHandler.java:42)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:24)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.hibernate.metamodel.spi.source.MappingException: Unable to 
perform unmarshalling at line number -1 and column -1. Message: 
cvc-complex-type.2.4.a: Invalid content was found starting with element 
'properties'. One of 
'{"http://www.hibernate.org/xsd/hibernate-mapping":discriminator, 
"http://www.hibernate.org/xsd/hibernate-mapping":natural-id, 
"http://www.hibernate.org/xsd/hibernate-mapping":version, 
"http://www.hibernate.org/xsd/hibernate-mapping":timestamp, 
"http://www.hibernate.org/xsd/hibernate-mapping":multi-tenancy, 
"http://www.hibernate.org/xsd/hibernate-mapping":idbag, 
"http://www.hibernate.org/xsd/hibernate-mapping":property, 
"http://www.hibernate.org/xsd/hibernate-mapping":many-to-one, 
"http://www.hibernate.org/xsd/hibernate-mapping":one-to-one, 
"http://www.hibernate.org/xsd/hibernate-mapping":component, 
"http://www.hibernate.org/xsd/hibernate-mapping":dynamic-component, 
"http://www.hibernate.org/xsd/hibernate-mapping":any, 
"http://www.hibernate.org/xsd!
 /hibernate-mapping":map, "http://www.hibernate.org/xsd/hibernate-mapping":set, 
"http://www.hibernate.org/xsd/hibernate-mapping":list, 
"http://www.hibernate.org/xsd/hibernate-mapping":bag, 
"http://www.hibernate.org/xsd/hibernate-mapping":array, 
"http://www.hibernate.org/xsd/hibernate-mapping":primitive-array, 
"http://www.hibernate.org/xsd/hibernate-mapping":join, 
"http://www.hibernate.org/xsd/hibernate-mapping":subclass, 
"http://www.hibernate.org/xsd/hibernate-mapping":joined-subclass, 
"http://www.hibernate.org/xsd/hibernate-mapping":union-subclass, 
"http://www.hibernate.org/xsd/hibernate-mapping":loader, 
"http://www.hibernate.org/xsd/hibernate-mapping":sql-insert, 
"http://www.hibernate.org/xsd/hibernate-mapping":sql-update, 
"http://www.hibernate.org/xsd/hibernate-mapping":sql-delete, 
"http://www.hibernate.org/xsd/hibernate-mapping":filter, 
"http://www.hibernate.org/xsd/hibernate-mapping":fetch-profile, 
"http://www.hibernate.org/xsd/hibernate-mapping":resultset, "http://www.!
 hibernate.org/xsd/hibernate-mapping":query, "http://www.hibern!
 ate.org/
xsd/hibernate-mapping":sql-query}' is expected.
at 
org.hibernate.metamodel.internal.JaxbHelper.unmarshal(JaxbHelper.java:182)
at 
org.hibernate.metamodel.internal.

Re: [hibernate-dev] hbm mapping exception

2012-07-30 Thread Strong Liu
Never mind, I got it fixed

On Jul 30, 2012, at 9:14 PM, Strong Liu  wrote:

> hibernate envers test 
> _org.hibernate.envers.test.integration.components.PropertiesGroupTest_ is 
> failing with the following exception, but I don't see there is a mapping xml 
> issue, could someone take a look?
> 
> 
> 
> 21:07:04,514  INFO Environment:342 - HHH21: Bytecode provider name : 
> javassist
> 21:07:04,534  INFO Dialect:125 - HHH000400: Using dialect: 
> org.hibernate.dialect.H2Dialect
> 21:07:04,719  INFO Dialect:125 - HHH000400: Using dialect: 
> org.hibernate.dialect.H2Dialect
> 21:07:04,857  INFO Version:37 - HCANN01: Hibernate Commons Annotations 
> {4.0.1.Final}
> Before class callback errror : 
> org.hibernate.testing.junit4.BaseCoreFunctionalTestCase#buildSessionFactory
> org.hibernate.testing.junit4.CallbackException: 
> org.hibernate.testing.junit4.BaseCoreFunctionalTestCase#buildSessionFactory
>   at 
> org.hibernate.testing.junit4.TestClassMetadata.invokeCallback(TestClassMetadata.java:199)
>   at 
> org.hibernate.testing.junit4.TestClassMetadata.performCallbacks(TestClassMetadata.java:190)
>   at 
> org.hibernate.testing.junit4.TestClassMetadata.performBeforeClassCallbacks(TestClassMetadata.java:181)
>   at 
> org.hibernate.testing.junit4.BeforeClassCallbackHandler.evaluate(BeforeClassCallbackHandler.java:43)
>   at 
> org.hibernate.testing.junit4.AfterClassCallbackHandler.evaluate(AfterClassCallbackHandler.java:42)
>   at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
>   at org.junit.runners.Suite.runChild(Suite.java:128)
>   at org.junit.runners.Suite.runChild(Suite.java:24)
>   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
>   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
>   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
>   at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
>   at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
>   at 
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
>   at 
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
>   at 
> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
>   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:601)
>   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: org.hibernate.metamodel.spi.source.MappingException: Unable to 
> perform unmarshalling at line number -1 and column -1. Message: 
> cvc-complex-type.2.4.a: Invalid content was found starting with element 
> 'properties'. One of 
> '{"http://www.hibernate.org/xsd/hibernate-mapping":discriminator, 
> "http://www.hibernate.org/xsd/hibernate-mapping":natural-id, 
> "http://www.hibernate.org/xsd/hibernate-mapping":version, 
> "http://www.hibernate.org/xsd/hibernate-mapping":timestamp, 
> "http://www.hibernate.org/xsd/hibernate-mapping":multi-tenancy, 
> "http://www.hibernate.org/xsd/hibernate-mapping":idbag, 
> "http://www.hibernate.org/xsd/hibernate-mapping":property, 
> "http://www.hibernate.org/xsd/hibernate-mapping":many-to-one, 
> "http://www.hibernate.org/xsd/hibernate-mapping":one-to-one, 
> "http://www.hibernate.org/xsd/hibernate-mapping":component, 
> "http://www.hibernate.org/xsd/hibernate-mapping":dynamic-component, 
> "http://www.hibernate.org/xsd/hibernate-mapping":any, 
> "http://www.hibernate.org/x!
 sd/hibernate-mapping":map, 
"http://www.hibernate.org/xsd/hibernate-mapping":set, 
"http://www.hibernate.org/xsd/hibernate-mapping":list, 
"http://www.hibernate.org/xsd/hibernate-mapping":bag, 
"http://www.hibernate.org/xsd/hibernate-mapping":array, 
"http://www.hibernate.org/xsd/hibernate-mapping":primitive-array, 
"http://www.hibernate.org/xsd/hibernate-mapping":join, 
"http://www.hibernate.org/xsd/hibernate-mapping":subclass, 
"http://www.hibernate.org/xsd/hibernate-mapping":joined-subclass, 
"http://www.hibernate.org/xsd/hibernate-mapping":union-subclass, 
"http://www.hibernate.org/xsd/hibernate-mapping":loader, 
"http://www.hibernate.org/xsd/hibernate-mapping":sql-insert, 
"http://www.hibernate.org/xsd/hibernate-mapping":sql-update, 
"http://www.hibernate.org/xsd/hibernate-mapping":sql-delete, 
"http://www.hibernate.org/xsd/hibernate-mapping":filter, 
"http://www.hibernate.org/xsd/hibernate-mapping":fetch-profile, 
"http://www.hibernate.org/xsd/hibernate-mapping":resultset, "http://ww!
 w.hibernate.org/xsd/hibernate-mapping":query, "http://www.hibe!
 rnate.or
g/xsd/hibern

[hibernate-dev] Jandex 1.1.0.Alpha1 released, supports composites

2012-07-30 Thread Jason T. Greene
Hi Steve et al,

I have included the API updates we discussed recently in the latest 
jandex release.

Javadoc:
http://jbossas.github.com/jandex/

-- 
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] integrate Envers with new metamodel

2012-07-30 Thread Strong Liu
https://hibernate.onjira.com/browse/HHH-7490

the problem is, envers needs to index its own annotations ( @Audited for 
example ), but the current Integrator api only passes in a Metadata instance.

so, we either pass in the Index or the MetadataImplementor has access to the 
all mapping entities

thoughts?
-
Best Regards,

Strong Liu 
http://about.me/stliu/bio

___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] Metamodel tests

2012-07-30 Thread Gail Badner
This is due to HHH-6566 (Create and drop SQL is not exported for 
PersistentIdentifierGenerator objects).

- Original Message -
> From: "Steve Ebersole" 
> To: "Strong Liu" 
> Cc: "Hibernate hibernate-dev" 
> Sent: Sunday, July 29, 2012 3:11:00 PM
> Subject: Re: [hibernate-dev] Metamodel tests
> 
> For what its worth... I tried adding this for y'all before I left,
> but
> it actually does not at all affect the tests.  Not sure what tests
> you
> saw failing because the id sequence/table is not there, but I tried a
> few tests that use sequences and they all fail trying to build the
> MetaData object.  If tests are failing because the sequences do not
> get
> exported to the database, the failures would be well after than point
> trying to issues SQL against the database.
> 
> Anyway I pushed the code that adds this to SchemaExport:
> https://github.com/hibernate/hibernate-orm/commit/b2ef3b67b2cb8a2e134bf08e267c29e78335650b
> 
> I'll hook in the new schema management tool service when i get back.
> 
> 
> On 07/29/2012 03:38 PM, Steve Ebersole wrote:
> > Just a reminder that I am on vacation this next week.
> >
> > If you want this in the meantime, you just need to alter the
> > org.hibernate.metamodel.spi.relational.Database#generateSchemaCreationScript
> > and
> > org.hibernate.metamodel.spi.relational.Database#generateDropSchemaScript
> > methods.   There is a
> > org.hibernate.metamodel.spi.relational.Schema#sequences collection,
> > but
> > they wont be populated using this
> > generateSchemaCreationScript/generateDropSchemaScript approach, so
> > in
> > there you will need a way to find all persistent identifier
> > generators
> > (please DO NOT collect them on Database/Schema) and handle it.
> >
> > Those methods will go away when I fully hook up the schema
> > management
> > tools (they are only used from SchemaExport) so don't worry about
> > breaking the schema management tool code.  And the new code will
> > add
> > sequences and tables from persistent identifier generator as we
> > discover
> > them (not coded yet)
> >
> > Or just wait till I get back..
> >
> > On 07/29/2012 01:35 PM, Steve Ebersole wrote:
> >>
> >> Yep I have not hooked my new schema management tool stuff into
> >> metamodel creation yet.
> >>
> >> On Jul 29, 2012 1:24 PM, "Strong Liu"  >> > wrote:
> >>
> >> btw, some tests are failing due to the identifier generator
> >> required sequence are not created.
> >>
> >> org.hibernate.id.PersistentIdentifierGenerator#sqlCreateStrings
> >> is
> >> never get called
> >>
> >> (yes, i see there is
> >> a org.hibernate.id.SequenceGenerator#registerExportables)
> >>
> >>
> >> and others are failing with stacktrace:
> >>
> >> javax.persistence.PersistenceException: [PersistenceUnit:
> >> FlushAndTransactionTest] Unable to build Hibernate
> >> SessionFactory
> >>at
> >>
> >> org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:973)
> >>at
> >>
> >> org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildEntityManagerFactory(EntityManagerFactoryBuilderImpl.java:782)
> >>at
> >>
> >> org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase.buildEntityManagerFactory(BaseEntityManagerFunctionalTestCase.java:93)
> >>at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown
> >>Source)
> >>at
> >>
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>at java.lang.reflect.Method.invoke(Method.java:601)
> >>at
> >>
> >> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
> >>at
> >>
> >> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> >>at
> >>
> >> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
> >>at
> >>
> >> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> >>at
> >>
> >> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
> >>at
> >>
> >> org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
> >> Caused by: org.hibernate.MappingException: Could not
> >> instantiate id generator
> >> [entity-name=org.hibernate.jpa.test.transaction.Book]
> >>at
> >>
> >> org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:123)
> >>at
> >>
> >> org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:219)
> >>at
> >>
> >> org.hibernate.internal.SessionFactoryImpl.(

Re: [hibernate-dev] Metamodel tests

2012-07-30 Thread Strong Liu
I think this is resolved now, Gail, could you verify?

On Jul 31, 2012, at 1:27 PM, Gail Badner  wrote:

> This is due to HHH-6566 (Create and drop SQL is not exported for 
> PersistentIdentifierGenerator objects).
> 
> - Original Message -
>> From: "Steve Ebersole" 
>> To: "Strong Liu" 
>> Cc: "Hibernate hibernate-dev" 
>> Sent: Sunday, July 29, 2012 3:11:00 PM
>> Subject: Re: [hibernate-dev] Metamodel tests
>> 
>> For what its worth... I tried adding this for y'all before I left,
>> but
>> it actually does not at all affect the tests.  Not sure what tests
>> you
>> saw failing because the id sequence/table is not there, but I tried a
>> few tests that use sequences and they all fail trying to build the
>> MetaData object.  If tests are failing because the sequences do not
>> get
>> exported to the database, the failures would be well after than point
>> trying to issues SQL against the database.
>> 
>> Anyway I pushed the code that adds this to SchemaExport:
>> https://github.com/hibernate/hibernate-orm/commit/b2ef3b67b2cb8a2e134bf08e267c29e78335650b
>> 
>> I'll hook in the new schema management tool service when i get back.
>> 
>> 
>> On 07/29/2012 03:38 PM, Steve Ebersole wrote:
>>> Just a reminder that I am on vacation this next week.
>>> 
>>> If you want this in the meantime, you just need to alter the
>>> org.hibernate.metamodel.spi.relational.Database#generateSchemaCreationScript
>>> and
>>> org.hibernate.metamodel.spi.relational.Database#generateDropSchemaScript
>>> methods.   There is a
>>> org.hibernate.metamodel.spi.relational.Schema#sequences collection,
>>> but
>>> they wont be populated using this
>>> generateSchemaCreationScript/generateDropSchemaScript approach, so
>>> in
>>> there you will need a way to find all persistent identifier
>>> generators
>>> (please DO NOT collect them on Database/Schema) and handle it.
>>> 
>>> Those methods will go away when I fully hook up the schema
>>> management
>>> tools (they are only used from SchemaExport) so don't worry about
>>> breaking the schema management tool code.  And the new code will
>>> add
>>> sequences and tables from persistent identifier generator as we
>>> discover
>>> them (not coded yet)
>>> 
>>> Or just wait till I get back..
>>> 
>>> On 07/29/2012 01:35 PM, Steve Ebersole wrote:
 
 Yep I have not hooked my new schema management tool stuff into
 metamodel creation yet.
 
 On Jul 29, 2012 1:24 PM, "Strong Liu" >>> > wrote:
 
btw, some tests are failing due to the identifier generator
required sequence are not created.
 
org.hibernate.id.PersistentIdentifierGenerator#sqlCreateStrings
is
never get called
 
(yes, i see there is
a org.hibernate.id.SequenceGenerator#registerExportables)
 
 
and others are failing with stacktrace:
 
javax.persistence.PersistenceException: [PersistenceUnit:
FlushAndTransactionTest] Unable to build Hibernate
SessionFactory
at

 org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:973)
at

 org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildEntityManagerFactory(EntityManagerFactoryBuilderImpl.java:782)
at

 org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase.buildEntityManagerFactory(BaseEntityManagerFunctionalTestCase.java:93)
at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown
Source)
at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at

 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at

 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at

 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at

 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at

 org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at

 org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
Caused by: org.hibernate.MappingException: Could not
instantiate id generator
[entity-name=org.hibernate.jpa.test.transaction.Book]
at

 org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:123)
at

 org.hibernate.mapping.SimpleVal