CUBRID Database Dialect for Hibernate
by 에센 사그노브
Hi,
I am the CUBRID open source RDBMS Project Manager. Our parent company NHN has extensively been using Hibernate in its services together with CUBRID Database Server.
Here I would like to attach the CUBRIDDialect.java class file which supports CUBRID version 8.3.0 and higher (8.3.0, 8.3.1, and current stable 8.4.0) that we want to submit to Hibernate project.
If I should create an issue in JIRA, please let me know which project is the most appropriate.
Regards,
Esen Sagynov.
CUBRID Project Manager.
http://www.cubrid.org
http://twitter.com/cubrid
http://facebook.com/cubrid
13 years, 3 months
hibernate-mapping-4.0.xsd issue?
by Strong Liu
------------------------ hbm --------------------------------------
<hibernate-mapping package="org.hibernate.metamodel.source.hbm" xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping hibernate-mapping-4.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<class name="SimpleEntity" >
<id name="id" access="field">
<generator class="increment"/>
</id>
<property name="name" access="field"/>
<timestamp name="date" access="field"/>
</class>
</hibernate-mapping>
--------------------------- stacktrace ------------------------------------
23:32:19,942 INFO Environment:2573 - HHH00412:Hibernate [WORKING]
23:32:20,010 INFO Environment:1986 - HHH00205:Loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.h2.Driver, hibernate.max_fetch_depth=5, hibernate.dialect=org.hibernate.dialect.H2Dialect, hibernate.format_sql=true, hibernate.cache.region.factory_class=org.hibernate.testing.cache.CachingRegionFactory, hibernate.connection.username=sa, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, hibernate.connection.pool_size=5}
23:32:20,012 INFO Environment:945 - HHH00021:Bytecode provider name : javassist
23:32:20,143 INFO Dialect:3062 - HHH00400:Using dialect: org.hibernate.dialect.H2Dialect
org.hibernate.metamodel.source.MappingException: Unable to perform unmarshalling at line number 36 and column 48. Message: cvc-complex-type.2.4.a: Invalid content was found starting with element 'timestamp'. One of '{"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":properties, "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":idbag, "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.hibernate.org/xsd/hibernate-mapping":sql-query}' is expected.
at org.hibernate.metamodel.source.internal.JaxbHelper.unmarshal(JaxbHelper.java:166)
at org.hibernate.metamodel.source.internal.JaxbHelper.unmarshal(JaxbHelper.java:82)
at org.hibernate.metamodel.MetadataSources.add(MetadataSources.java:171)
at org.hibernate.metamodel.MetadataSources.addResource(MetadataSources.java:160)
at org.hibernate.metamodel.source.hbm.TypeResolveTests.testSimpleEntityMapping(TypeResolveTests.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.hibernate.testing.junit4.FailureExpectedHandler.evaluate(FailureExpectedHandler.java:59)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
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:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'timestamp'. One of '{"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":properties, "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":idbag, "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.hibernate.org/xsd/hibernate-mapping":sql-query}' is expected.]
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:414)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:395)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:368)
at org.hibernate.metamodel.source.internal.JaxbHelper.unmarshal(JaxbHelper.java:155)
... 36 more
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'timestamp'. One of '{"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":properties, "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":idbag, "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.hibernate.org/xsd/hibernate-mapping":sql-query}' is expected.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3182)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1806)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:550)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:78)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:60)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.handleStartElement(StAXEventConnector.java:247)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge(StAXEventConnector.java:116)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:392)
... 38 more
Process finished with exit code 255
-----------
Strong Liu <stliu(a)hibernate.org>
http://hibernate.org
http://github.com/stliu
13 years, 4 months
Hibernate4 artifact names, Persistence provider name, maven...
by Scott Marlow
If someone wanted to include both Hibernate 3 + Hibernate 4 in the same
project, that might be easier if the Hibernate 4 artifacts had a version
number in it or was changed for every new major release. I don't think
Maven supports building two versions of the same artifact (at the same
dependency level).
For the persistence provider name,
org.hibernate.ejb.HibernatePersistence, I'm wondering if we could have a
org.hibernate.ejb.HibernatePersistence4 in addition, that could be used
to uniquely reference Hibernate 4.x persistence providers.
I assume this is too late in the Hibernate 4 cycle to change, but wanted
to bring the idea up.
Changing the artifact names would impact other projects that depends on
Hibernate4 and would need to sync up with the changes as well.
What do you think?
Scott
13 years, 4 months
HSEARCH Serialization protocol ready for trunk
by Emmanuel Bernard
I'm done with the serialization protocol. At least, it's in a good shape and should be integrated with trunk
It uses Avro and is now integrated with both JGroups and JMS backends.
I've abstracted Avro from our serialization logic so we can write alternative prototypes. I'd be interested to see a Protocol Buffer alternative for example. If anyone is interested, check out SerializationProvider and it's inplementation AvroSerializationProvider
Not everything is polished, I've created a list of follow up issues to be fixed before 4.0. https://hibernate.onjira.com/browse/HSEARCH-757
These a good candidates for community contribution.
I have one minor question
Should hibernate.search.jms.indexNameProperty that be part of the protocol or left separate like today?
I'll send a pull request in the next few minutes
Emmanuel
13 years, 4 months
HSEARCH State to transfer
by Emmanuel Bernard
HSEARCH-681 HSEARCH-757
I've done a first analysis for the state to transfer. It's not too bad.
This doc is cryptic but people familiar with Lucene should get what I mean:
https://gist.github.com/1120651
It describes the state to pass around for each operation and detail what Document and Fieldable contain state wise and what would be transferred.
The two big annoyances are:
- Reader
- TokenStream
both of them can be the source of a Field.
While we can envision some strategies for Reader (worse case being we read the data and ship it over). I have not yet analyzed the implications of TokenStream.
For the rest with a smart enough state machine and possibly some private attribute reading, we should be able to serialize / deserialize Documents and Fieldables
Emmanuel
13 years, 4 months
Does anyone know of any HQL internal changes between Hibernate 4.0.0.Beta3 and 4.0.0.Beta4?
by Scott Marlow
http://pastebin.com/SR3jsxGp contains the call stack for a
ClassNotFoundException of org.hibernate.hql.internal.ast.HqlToken (from
https://issues.jboss.org/browse/AS7-1433). The exception message isn't
shown but the jira has that.
I tried the supplied test case against Hibernate 4.0.0.Beta3 and don't
have the same problem. Does anyone know of a Hibernate 4.0.0.Beta4
change that could of caused this?
Perhaps we need to set the TCCL to the hibernate CL when constructing
the HqlBaseLexer as a workaround (the Hibernate classloader depends on
the antlr classloader module, so that should work).
Whatever the solution is, I'd like to better understand what changed to
cause this.
Thanks,
Scott
13 years, 4 months
Re: [hibernate-dev] classloading issue when trying to add envers to as7
by Scott Marlow
On 08/03/2011 11:44 AM, Strong Liu wrote:
> Hi there,
>
> I get envers embedded into as7 :D
>
> see below:
>
> https://github.com/stliu/hibernate-core/tree/classloading
> https://github.com/stliu/jboss-as/tree/as7-928-2
>
> 1. org.hibernate module and org.hibernate.envers module depends on each other.
We might make the Hibernate to envers dependency optional in the
org.hibernate module.xml:
<module name="org.envers" optional="true"/>
So, that it is possible for the envers module to be removed for some
reason (I cannot think of why at the moment but just a thought).
> 2. org.hibernte.envers module automaticly injected into app when it is a jpa project.
This is where it gets tricky to package envers with the app. Have you
synced up with AS7 (7.0.1) master yet? I have another change coming
that could impact yours (in queue waiting to be merged).
Anyway, start with packaging envers as a standalone module and try
bringing a envers test into the as7/testsuite/compat/* based on the
current embedded test (there are only two tests and one is @Ignored).
> 3. org.jboss.as.testsuite.integration.jpa.hibernate.envers.BasicEnversTestCase in as7/testsuite/integration passes
Nice work! :-)
> 4. use org.hibernate.integrator.internal.ServiceLoader instead java.util.ServiceLoader to load META-INF/services file
> this custom ServiceLoader uses ClassLoaderService.
>
> sounds okay?
>
> Scott, question, if there is envers.jar embedded in app too, will app class loader see it before the envers.jar in org.hibernate.envers module?
As mentioned above, special care is needed to avoid having two envers
classloaders in the app deployment. We might have to make further
changes to not inject envers into the app, if the app already has its
own hibernate + envers.
>
> -------------------------
> Best Regards,
>
> Strong Liu<stliu at redhat.com>
> http://about.me/stliu/bio
>
>
>
> On Aug 3, 2011, at 6:25 PM, Strong Liu wrote:
>
>>
>> Begin forwarded message:
>>
>>>
>>> Adam,
>>>
>>> can you send your test app to me?
>>>
>>> use cases:
>>>
>>> 1. envers and hibernate core in as7
>>> 2. envers jar in app, and hibernate core in as7
>>> 3. envers and hibernate core in app
>>>
>>> #1 is almost done, just need some code clean up
>>> (Scott, we missed services="import", that's why ClassLoaderService can't find resource in envers/META-INF/services)
>>
>
13 years, 4 months