[Hibernate-JIRA] Created: (HHH-2656) Using EntityMode.DOM4J results in an exception when mapping more than one collection to the root node (node=".")
by Andries Schutte (JIRA)
Using EntityMode.DOM4J results in an exception when mapping more than one collection to the root node (node=".")
----------------------------------------------------------------------------------------------------------------
Key: HHH-2656
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2656
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: Hibernate 3.2.4 SP1, tested with MySQL 5.0.
Reporter: Andries Schutte
When mapping multiple collections to the root node, an exception results (mapping and exception stack trace is shown below). This works fine if only one collection is mapped to the root node, or if one explicitly specifies unique names for each collection parent node. We are unfortunately restricted by having to use customer-defined XSDs, so this is a show-stopper for us.
<?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>
<class entity-name="ProcessImpl" table="PROCESSES" node="Process">
<id name="sysID" column="PROCESS_ID" node="sysID" type="string"/>
<property name="version" column="PROCESS_VERSION" node="version" type="string"/>
<property name="processType" column="PROCESS_TYPE" node="processType" type="string"/>
<property name="status" column="PROCESS_STATE" node="status" type="string"/>
<property name="createDate" column="PROCESS_CREATE_DATE" node="createDate" type="timestamp"/>
<property name="creator" column="PROCESS_CREATOR" node="creator" type="string"/>
<property name="transactionNumber" column="PROCESS_TX_NUMBER" node="transactionNumber" type="long"/>
<property name="modifiedDate" column="PROCESS_MOD_DATE" node="modifiedDate" type="timestamp"/>
<property name="modifier" column="PROCESS_MODIFIER" node="modifier" type="string"/>
<property name="title" column="PROCESS_TITLE" node="title" type="string"/>
<property name="timer" column="PROCESS_TIMER" node="timer" type="string"/>
<property name="currentCSTime" column="PROCESS_CS_TIME" node="currentCSTime" type="timestamp"/>
<bag name="requiredActivities"
table="REQ_ACTIVITIES" node = "." embed-xml="true" lazy="false" cascade="all">
<key column="PROCESS_ID" not-null="true"/>
<element column="REQ_ACTIVITY" type="text" node="requiredActivity"/>
</bag>
<bag name="retractedGuidelines"
table="RET_GUIDELINES" node = "." embed-xml="true" lazy="false" cascade="all">
<key column="PROCESS_ID" not-null="true"/>
<element column="RET_GUIDELINE" type="text" node="retractedGuideline"/>
</bag>
<set name="suspendedGuidelines"
node = "." embed-xml="true" lazy="false" cascade="all">
<key column="PROCESS_ID" not-null="true"/>
<one-to-many entity-name="SuspendedGuidelineImpl"
embed-xml="true" node="suspendedGuideline"/>
</set>
</class>
</hibernate-mapping>
Exception stack trace:
[6/6/07 22:11:41:246 GMT] 00000012 SystemErr R org.hibernate.HibernateException: Found shared references to a collection: ProcessImpl.retractedGuidelines
at org.hibernate.engine.Collections.processReachableCollection(Collections.java:163)
at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:37)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:61)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:131)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at com.resonant.persistence.ExternalDataMgrHibernateDom4jImpl.persistHibernateEntity(ExternalDataMgrHibernateDom4jImpl.java:194)
at com.resonant.persistence.ExternalDataMgrHibernateDom4jImpl.store(ExternalDataMgrHibernateDom4jImpl.java:172)
at com.resonant.persistence.PersistenceHibernateDom4jImpl.storeObject(PersistenceHibernateDom4jImpl.java:215)
at com.resonant.persistence.ejb.PersistenceLocalBean.storeObject(PersistenceLocalBean.java:192)
at com.resonant.persistence.ejb.EJSLocalStatelessPersistenceLocalEJB_68e55914.storeObject(EJSLocalStatelessPersistenceLocalEJB_68e55914.java:1179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.springframework.ejb.access.LocalSlsbInvokerInterceptor.invoke(LocalSlsbInvokerInterceptor.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy2.storeObject(Unknown Source)
at com.resonant.hub.processmanager.ProcessHubImpl.startProcess(ProcessHubImpl.java:179)
at com.resonant.hub.processmanager.ejb.ProcessHubBean.startProcess(ProcessHubBean.java:138)
at com.resonant.hub.processmanager.ejb.EJSRemoteStatelessProcessHubEJB_f45832db.startProcess(EJSRemoteStatelessProcessHubEJB_f45832db.java:208)
at com.resonant.hub.processmanager.ejb._EJSRemoteStatelessProcessHubEJB_f45832db_Tie.startProcess(_EJSRemoteStatelessProcessHubEJB_f45832db_Tie.java:261)
at com.resonant.hub.processmanager.ejb._EJSRemoteStatelessProcessHubEJB_f45832db_Tie._invoke(_EJSRemoteStatelessProcessHubEJB_f45832db_Tie.java:122)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:613)
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:466)
at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1552)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2673)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2551)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:95)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[Hibernate-JIRA] Created: (HHH-2140) SQLQueryParser throws ArrayIndexOutOfBoundsException: -1 for SQL query with join mapped as set of string elements
by Artur Jonak (JIRA)
SQLQueryParser throws ArrayIndexOutOfBoundsException: -1 for SQL query with join mapped as set of string elements
-----------------------------------------------------------------------------------------------------------------
Key: HHH-2140
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2140
Project: Hibernate3
Type: Bug
Components: query-sql
Versions: 3.1.3
Reporter: Artur Jonak
I have the following mapping:
<class name="GCPSimpleDocumentImpl" table="GCP_Node" mutable="false">
<id name="DocumentId" />
...
<set name="ApplicationAreas" table="GCP_ApplicationArea" cascade="none" order-by="Name" sort="natural" mutable="false">
<key column="DocumentId"/>
<element type="string" column="Name"/>
</set>
</class>
and I try to run an SQL query:
List result = session.createSQLQuery(
"select distinct {node.*}, {areas.*} from GCP_Node node join GCP_ApplicationArea areas on node.DocumentId=areas.DocumentId " +
"where areas.Name like 'BS - CF%'")
.addEntity("node", GCPSimpleDocumentImpl.class)
.addJoin("areas", "node.ApplicationAreas")
.list();
Unfortunately I get the following exception:
java.lang.ArrayIndexOutOfBoundsException: -1
at org.hibernate.loader.custom.SQLQueryParser.substituteBrackets(SQLQueryParser.java:133)
at org.hibernate.loader.custom.SQLQueryParser.process(SQLQueryParser.java:85)
at org.hibernate.loader.custom.SQLCustomQuery.<init>(SQLCustomQuery.java:157)
at org.hibernate.engine.query.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:20)
at org.hibernate.engine.query.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:113)
at org.hibernate.impl.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:137)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 5 months
[Hibernate-JIRA] Created: (HHH-2401) CLOB truncation on DB2 when using 2 or 3 byte chars (UTF8)
by Simon Jongsma (JIRA)
CLOB truncation on DB2 when using 2 or 3 byte chars (UTF8)
----------------------------------------------------------
Key: HHH-2401
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2401
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.ga
Environment: Hibernate 3.2.0 GA + JBoss 4.0.4.GA on Windows XP + DB2 UDB for ISeries V5R3 + IBM JT Open driver 4.9
Reporter: Simon Jongsma
Priority: Minor
Attachments: ClobTruncated.zip
A CLOB column is used in DB2 mapped to a String in Java with the Hibernate "Text" mapping.
The column in DB2 has a CCSID 1208 which means "UTF8" (= Unicode).
The CLOB truncation occurs when characters are used that are UTF8 coded in more than one byte.
In that the string is truncated when persisted in the database.
For example the string
"Granpré Molière†; 0123456789". This string has three diacritical marks in it.
The é and è are coded in two bytes in UTF8 and the † in three bytes.
This string will be stored as "Granpré Molière†; 012345".
So "6789" is not stored.
It appears as though Hibernate does not take into account that a character can be more than 1 byte in UTF8.
The number of missing char's at the end is exactly: string.getBytes("UTF-8").length minus string.length()
It is not a problem of DB2 or the JT Open driver:
Storing and retrieving (from a Java program) the same String directly via Jdbc into the DB2 table and retrieving it, works 100% fine.
So this clearly points to a problem somewhere in Hibernate.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 5 months
[Hibernate-JIRA] Créée: (HHH-2086) Patch for bug HHH-2076 and to be able to use <formula> in <key> for <one-to-many>
by Xavier Brénuchon (JIRA)
Patch for bug HHH-2076 and to be able to use <formula> in <key> for <one-to-many>
---------------------------------------------------------------------------------
Key: HHH-2086
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2086
Project: Hibernate3
Type: Patch
Components: core
Versions: 3.2.0.cr4
Reporter: Xavier Brénuchon
Attachments: formula_one_to_many.patch
Hello,
There is a patch to correct bug HHH-2076 and make an improvement for HHH-944.
In fact, theses 2 cases are linked. They need, amongst other things, a formula in the right part of outer join.
This patch is simple but many class concerns (to propagate formula templates).
About formula in one-to-many :
You must have at least a column (not only formula), because it's not possible to have an Update order without at least a column. If it is the case, hibernate patch will raise an MappingException rightly.
This patch add two TestCase :
org.hibernate.test.onetoone.bidirectionnalformula. OneToOneBidirectionalFormulaTest
org.hibernate.test.onetomany.formula. OneToManyFormulaTest
Would it be possible to integrate this patch into Hibernate 3.2 ?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 5 months
[Hibernate-JIRA] Created: (HBX-812) Fetching Children of Database _crawls_.
by Syd Poetry (JIRA)
Fetching Children of Database _crawls_.
---------------------------------------
Key: HBX-812
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-812
Project: Hibernate Tools
Type: Bug
Components: reverse-engineer
Versions: 3.2beta8
Environment: MySQL 5.0, Eclipse 3.2, JDK 1.5, Beta8 for Hibernate Tools
Reporter: Syd Poetry
I just updated a bunch of components for Eclipse (mostly related to Visual Editor); added a couple of tables to my database, went to regenerate all the POJO clases .hbm.xml mapping files, and found that anything that queries the database schema runs abysmally slow.
Updated the tools from beta6 to beta8 thinking it might be a conflict with one of the updates that was performed, still very slow (5+ minutes to retrieve a list of tables!). Deleted all my hibernate-related XML files thinking it might be a parsing error, went to generate a new console file, and revenge.xml, found out that any listbox that tried to access the schema appeared to be hanging. It finishes after much hard-drive crunching. I have 2.2 GBs free running windows XP, MEM usage is 856 MB out of 1.5 GB physical memory. Just out of curiousity, is *anyone* else having this slow response for schema detection? I'm wondering if I have to update another component like a driver or something like that.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 6 months
[Hibernate-JIRA] Created: (HBX-895) Content assist doesn't work when an entity alias is not preceded by whitespace
by Joseph Marques (JIRA)
Content assist doesn't work when an entity alias is not preceded by whitespace
------------------------------------------------------------------------------
Key: HBX-895
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-895
Project: Hibernate Tools
Type: Bug
Versions: 3.2beta8
Reporter: Joseph Marques
In an HQL editor:
If I type - "count(col." - and press ctrl+space, I don't get the content assist for col
If I type - "count( col." - and press ctrl+space, I do
Similarly,
If I type - "select a,b." - and press ctrl+space, I don't get the content assist for b
If I type - "select a, b." - and press ctrl+space, I do
It's pretty clear that the lexing is a little bit too tight here, and that for better usability it should be relaxed. The second case isn't as big a deal as the first (because I don't know a single person that doesn't comma-space delimit the select clause, but I'm thinking that some people that don't realize that they have to put a space in front of it might think that the tools simply can't auto-complete inside functions.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 6 months