[Hibernate-JIRA] Created: (HHH-4087) Session.flush() Causes AssertionFailure
by Brian (JIRA)
Session.flush() Causes AssertionFailure
----------------------------------------
Key: HHH-4087
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4087
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Reporter: Brian
After calling Session.save() with an entity, calling Session.flush() causes the following error.
org.hibernate.AssertionFailure: collection [com.example.myList] was not processed by flush()
at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:205)
at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:333)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
The mapping used was:
<component name="component" class="Component">
<property name="sequence" column="SEQUENCE" not-null="false" generated="insert"/>
<list name="myList" table="MY_LIST">
<key column="MY_LIST_KEY"/>
<index column="INDEX_COL"/>
<composite-element class="MyCompositeElement">
<property name="element" column="ELEMENT"/>
</composite-element>
</list>
</component>
--
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
[Hibernate-JIRA] Created: (HHH-3590) Having @version in Parent causes wrong HQL update when updating subclass in Joined Subclass Inheritance Strategy.
by Rachit (JIRA)
Having @version in Parent causes wrong HQL update when updating subclass in Joined Subclass Inheritance Strategy.
-----------------------------------------------------------------------------------------------------------------
Key: HHH-3590
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3590
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.3.1
Environment: Java 1.5 , Oracle 10g , Hibernate 3.3.1.GA
Reporter: Rachit
Priority: Blocker
A very simple joined subclass strategy implemented.
2 classes: Employee(parent/superclass) and Person( child/subclass)
Employee has @Version defined on column ROW_VERSION and Person extends Employee using Joined Inheritance Strategy. Person has PERSON_ID as PK and Employee has EMPLOYEE_ID as PK. I also have @PrimaryKeyJoinColumn(name = "PERSON_ID", referencedColumnName = "EMPLOYEE_ID") for obvious reason.
Now if I update any attribute in Child class i.e Person.setVIPFlag("Y") , hibernate fires an update query on Parent entity with wrong column name in hql. In this case the query would be "update EMPLOYEE set ROW_VERSION=? where PERSON_ID=? and ROW_VERSION=?". This query fails as EMPLOYEE does not have PERSON_ID.
The moment I remove @Version annotation from Parent(Employee) class, there is no update ( as expected ) and hence no error, but this is not an acceptable solution.
Thanking in anticipation.
--
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
[Hibernate-JIRA] Created: (HHH-2146) NullpointerException in DefaultDeleteEventListener.deleteTransientEntity
by Martin Kartumovich (JIRA)
NullpointerException in DefaultDeleteEventListener.deleteTransientEntity
------------------------------------------------------------------------
Key: HHH-2146
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2146
Project: Hibernate3
Type: Bug
Versions: 3.2.0.cr5
Environment: Hibernate 3.2.0cr5, Oracle10g
Reporter: Martin Kartumovich
Priority: Blocker
The following setup leads to a NPE in DefaultDeleteEventListener.deleteTransientEntity:
Tables A, B
Table V_A_B that is an M-N-Connection between A and B.
Pojo for A has a Set of V_A_Bs.
Pojo for B has a Set of V_A_Bs.
Pojo C that has Sets of As and Bs.
Cascades: all, delete-orphan
-Create a new A and add a new V_A_B to its Set, that references to an existing B.
-Delete B.
-SaveOrUpdate Pojo C.
In Hibernate 3.1.3 this works fine.
In 3.2.0cr4+cr5 the removal of B results into an cascading removal of the never persisted V_A_B in the Set of B instead of ignoring it.
This leads to an incorrect state where deleteTransientEntity is called with transientEnties=null.
When now calling transientEnties.contains(...) the NPE is thrown.
--
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
[Hibernate-JIRA] Created: (HHH-2624) NullPointerException when Query.list()
by Eddie Man (JIRA)
NullPointerException when Query.list()
--------------------------------------
Key: HHH-2624
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2624
Project: Hibernate3
Issue Type: Bug
Components: core
Environment: MySQL database
Reporter: Eddie Man
Priority: Critical
Attachments: src.zip
The following exception was thrown when I calling Query.list():
Exception in thread "main" java.lang.NullPointerException
at org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1641)
at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:608)
at org.hibernate.type.EntityType.resolve(EntityType.java:382)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
Reference issue :
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-48
Steps for reproduce the problem
==================
1. Unzip the attached file.
2. Execute the "schema.ddl" to create the tables.
3. Execute the "data.ddl" to insert the simple records.
4. Compile the src, and run the Main class.
--
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
[Hibernate-JIRA] Created: (HHH-3975) Sybase doesn't allow to set a null value for text field when save object
by Siuloong Ju (JIRA)
Sybase doesn't allow to set a null value for text field when save object
------------------------------------------------------------------------
Key: HHH-3975
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3975
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Sybase 15.0.2 development liesence for windows
Hibernate:3.3.1
Reporter: Siuloong Ju
Priority: Critical
Save an object with one field mapped to sybase text type.
if the object text field doesn't be set a not-null value,then the object cann't be save.
HBM file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.test.sybase" default-access="field">
<class name="TestPO" table="TB_TEST">
<id name="id" column="hid" type="long" access="property">
<generator class="native"/>
</id>
<property name="extractID" type="java.lang.String" update="true" insert="true" column="extractID" length="60" not-null="true"/>
<property name="transactionID" type="java.lang.String" update="true" insert="true" column="transactionID" length="60" not-null="false"/>
<property name="testText" column="testText" type="text" not-null="false"/>
</class>
</hibernate-mapping>
the exceptions info:
JZ006: 捕获到 IO 例外:java.io.IOException: JZ0SL: 不受支持的 SQL 类型 2005。
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not insert: [com.wonders.sybase.TestPO]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2186)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2666)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:562)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:550)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:546)
at com.wonders.sybase.SybaseTest.testSaveByHiberate(SybaseTest.java:39)
at com.wonders.sybase.SybaseTest.main(SybaseTest.java:27)
Caused by: java.sql.SQLException: JZ006: 捕获到 IO 例外:java.io.IOException: JZ0SL: 不受支持的 SQL 类型 2005。
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown Source)
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseErrorCheckDead(Unknown Source)
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.language(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.sendQuery(Unknown Source)
at com.sybase.jdbc3.jdbc.SybPreparedStatement.sendQuery(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.execute(Unknown Source)
at com.sybase.jdbc3.jdbc.SybPreparedStatement.execute(Unknown Source)
at org.hibernate.id.IdentityGenerator$InsertSelectDelegate.executeAndExtract(IdentityGenerator.java:138)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 17 more
--
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
[Hibernate-JIRA] Created: (HHH-4063) NPE reading metadata from an mapped interface
by Hernán Chanfreau (JIRA)
NPE reading metadata from an mapped interface
---------------------------------------------
Key: HHH-4063
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4063
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.2
Environment: Hibernate-core 3.3.2GA, Envers 1.2.1GA
Reporter: Hernán Chanfreau
Attachments: interface.mapping.test.zip
The problem arises when there is a mapped interface to load as a persistent class.
The metadata reader from envers do not care about interfaces.
See the discussion about it here:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=156233
We've patch envers doing this:
In AuditedPropertiesReader.addPropertiesFromClass(XClass clazz) we add the condition superclazz != null.
private void addPropertiesFromClass(XClass clazz) {
XClass superclazz = clazz.getSuperclass();
// superclazz != null applies when superclazz is an interface
if ((superclazz != null) && (!"java.lang.Object".equals(superclazz.getName()))) {
addPropertiesFromClass(superclazz);
}
addFromProperties(clazz.getDeclaredProperties("field"), "field", fieldAccessedPersistentProperties);
addFromProperties(clazz.getDeclaredProperties("property"), "property", propertyAccessedPersistentProperties);
}
--
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
[Hibernate-JIRA] Created: (ANN-841) Bidirectional indexed collection mapped incorrectly for IndexedCollectionTest
by Gail Badner (JIRA)
Bidirectional indexed collection mapped incorrectly for IndexedCollectionTest
-----------------------------------------------------------------------------
Key: ANN-841
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-841
Project: Hibernate Annotations
Issue Type: Bug
Reporter: Gail Badner
Assignee: Emmanuel Bernard
Attachments: TEST-org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.xml
I believe that two bidirectional associations with indexed collections that use join tables are mis-mapped for org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.
Mappings in AddressBook:
@MapKey
@OneToMany(mappedBy = "book", cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE})
@JoinTable(name="AddRegEntry")
public Map<AddressEntryPk, AddressEntry> getEntries() {
return entries;
}
@MapKey(name = "directory")
@OneToMany(mappedBy = "book")
@JoinTable(name="Dir_Entry")
public Map<AlphabeticalDirectory, AddressEntry> getDirectoryEntries() {
return directoryEntries;
}
Mappings in AddressEntry:
@ManyToOne
public AddressBook getBook() {
return book;
}
@ManyToOne
public AlphabeticalDirectory getDirectory() {
return directory;
}
AddRegEntry and Dir_Entry are not generated in the DDL and the CRUD operations do not reference the join tables.
Test output is attached.
--
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