[Hibernate-JIRA] Created: (HSEARCH-488) Nested use of @ContainedIn: changes not propagated to Lucene index
by Pieter van den Brink (JIRA)
Nested use of @ContainedIn: changes not propagated to Lucene index
------------------------------------------------------------------
Key: HSEARCH-488
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-488
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA
Environment: Hibernate-core 3.3.2.GA
PostgreSQL 8.4.2, testcase reproduced in hsqldb 1.8.0.7
Reporter: Pieter van den Brink
Attachments: TestNestedContainedIn.zip
I'm having trouble getting Hibernate Search to automatically update the Lucene index for entities which are @ContainedIn an entity, which is again @ContainedIn another entity.
The class structure in this example is as follows: There are HelpItems and Tags, which are linked many-to-many via another entity HelpItemTag. The HelpItem is the only @Indexed entity, it embeds all tags via @IndexedEmbedded. If an indexed (@Field) property of Tag changes, the change is not propagated to the Lucene index.
See the discussion at https://forum.hibernate.org/viewtopic.php?f=9&t=1003637 for a complete description.
I have added a standalone testcase that reproduces the issue. As you can see in the the first testcase, the Tag name is indexed properly as part of the HelpItem, but the second testcase fails because the changed Tag name is not update in the Lucene index.
--
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
16 years
[Hibernate-JIRA] Created: (HHH-5102) Instances of a subclass can't be loaded
by Saša Obradović (JIRA)
Instances of a subclass can't be loaded
---------------------------------------
Key: HHH-5102
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5102
Project: Hibernate Core
Issue Type: Bug
Components: annotations, core, entity-manager
Affects Versions: 3.5.0-Final
Environment: Hibernate 3.5.0-Final, Oracle
Reporter: Saša Obradović
Priority: Blocker
Attachments: acount.jpg, columnnotfoundbug.zip, oracle.sql
For a simple class hierarchy (strategy: joined, using @MappedSuperclass) an instance can't be loaded from the database using the superclass as type:
{{Account account = entityManager.find(Account.class, 404L);}}
This works fine in any Hibernate version prior to the latest and is an obvious bug in 3.5.0-Final.
{quote}
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not load an entity: [hibernatebug.Account#404]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1179)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:575)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:529)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
at $Proxy90.find(Unknown Source)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy90.find(Unknown Source)
at at.ing.diba.service.architektur.BugTest.getSavingsAccount_aroundBody2(BugTest.java:40)
at at.ing.diba.service.architektur.BugTest$AjcClosure3.run(BugTest.java:1)
at at.ing.diba.manager.ServiceMethodTracingAspect.traceServiceMethod(ServiceMethodTracingAspect.java:40)
at at.ing.diba.service.architektur.BugTest.getSavingsAccount(BugTest.java:40)
at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:158)
Caused by: org.hibernate.exception.GenericJDBCException: could not load an entity: [hibernatebug.Account#404]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1937)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:554)
... 47 more
Caused by: java.sql.SQLException: Ungültiger Spaltenname
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3296)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1914)
at oracle.jdbc.driver.OracleResultSet.getBigDecimal(OracleResultSet.java:2042)
at org.hibernate.type.BigDecimalType.get(BigDecimalType.java:46)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2267)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1423)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1351)
at org.hibernate.loader.Loader.getRow(Loader.java:1251)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:619)
at org.hibernate.loader.Loader.doQuery(Loader.java:745)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1933)
... 59 more
{quote}
(''Ungültiger Spaltenname'' means: column not found)
The generated SQL-Statements are different:
3.5.0-Final:
{quote}
/* load hibernatebug.Account */ select
account0_.ACC_ID as ACC1_30_0_,
account0_.ACC_IBAN as ACC2_30_0_,
account0_.ACC_VERSION as ACC3_30_0_,
case
when account0_1_.SAVACC_ACC_ID is not null then 1
when account0_.ACC_ID is not null then 0
end as clazz_0_
from
ACCOUNT account0_
left outer join
SAVINGS_ACCOUNT account0_1_
on account0_.ACC_ID=account0_1_.SAVACC_ACC_ID
where
account0_.ACC_ID=?
{quote}
3.3.2.GA:
{quote}
/* load hibernatebug.Account */ select
account0_.ACC_ID as ACC1_36_0_,
account0_.ACC_IBAN as ACC2_36_0_,
account0_.ACC_VERSION as ACC3_36_0_,
account0_1_.SAVACC_WITHDRAWALLIMIT as SAVACC1_44_0_,
case
when account0_1_.SAVACC_ACC_ID is not null then 1
when account0_.ACC_ID is not null then 0
end as clazz_0_
from
ACCOUNT account0_
left outer join
SAVINGS_ACCOUNT account0_1_
on account0_.ACC_ID=account0_1_.SAVACC_ACC_ID
where
account0_.ACC_ID=?
{quote}
--
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
16 years
[Hibernate-JIRA] Created: (HHH-5103) Specifying the referencedColumnName in a @JoinColumn in backtics like `uid` fails
by Samuel Mendenhall (JIRA)
Specifying the referencedColumnName in a @JoinColumn in backtics like `uid` fails
----------------------------------------------------------------------------------
Key: HHH-5103
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5103
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Affects Versions: 3.2.4.sp1
Environment: EAP 4.3 with Hibernate commons annotations 3.0.0.GA and Hibernate core 3.2.4.sp1.cp09
Reporter: Samuel Mendenhall
Priority: Minor
Given a column with a defined name in backtics like so
@Id
@GeneratedValue
@Column(name = "`uid`")
private long userid;
A @JoinTable/@JoinColumn mapping fails if specifically referencing the backtic name, instead one must leave off the backtics so the discovery can happen based on the pk.
This fails:
@JoinTable(name = "SYS_GROUPS_USERS", joinColumns = @JoinColumn(name = "USERID", referencedColumnName = "`uid`"), inverseJoinColumns = @JoinColumn(name = "GROUPID", referencedColumnName = "GROUPID"))
While this works:
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "SYS_GROUPS_USERS", joinColumns = @JoinColumn(name = "USERID"), inverseJoinColumns = @JoinColumn(name = "GROUPID"))
The exception is
Caused by: org.hibernate.AnnotationException: Column name uid of org.domain.seam202.entity.SysUserOrm not found in JoinColumns.referencedColumnName
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:321)
at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:1322)
at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:1161)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:600)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:541)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1136)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:323)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
--
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
16 years