[Hibernate-JIRA] Created: (HHH-5183) Inheritance (single table) and @SecondaryTable
by Nicolas Romanetti (JIRA)
Inheritance (single table) and @SecondaryTable
-----------------------------------------------
Key: HHH-5183
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5183
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.2
Environment: Hibernate 3.3.2.GA
H2 Database version 1.2.131
Reporter: Nicolas Romanetti
When @SecondaryTable is declared (with the same secondary table name)
in 2 distinct entities that belong to the same hierarchy (single table inheritance), hibernate considers
that the secondary tables are different!
Indeed, when persisting the entity, if the properties (using the secondary table) are set in
the entity itself and its parent, hibernate does 2 inserts on the secondary table instead of one
(one for the 'secondary' property of the parent, and one for the 'secondary' property of the current entity)
This triggers a pk violation exception as the same PK is used twice on the secondary table.
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (HHH-5030) BaseRegionAdapter shouldn't rely on optional Cache#toMap method
by Adrian Hummel (JIRA)
BaseRegionAdapter shouldn't rely on optional Cache#toMap method
---------------------------------------------------------------
Key: HHH-5030
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5030
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.5.0-CR-2
Environment: hibernate-oscache 3.5.0.Beta-1
Reporter: Adrian Hummel
Attachments: bugreport.zip
Get an {{UnsupportedOperationException}} when checking the L2 cache if it contains an entity:
{code}
emf.getCache().contains(MyEntity.class, pk);
{code}
Result:
{code}
java.lang.UnsupportedOperationException
at org.hibernate.cache.OSCache.toMap(OSCache.java:126)
at org.hibernate.cache.impl.bridge.BaseRegionAdapter.contains(BaseRegionAdapter.java:62)
at org.hibernate.impl.SessionFactoryImpl$CacheImpl.containsEntity(SessionFactoryImpl.java:967)
at org.hibernate.impl.SessionFactoryImpl$CacheImpl.containsEntity(SessionFactoryImpl.java:962)
at org.hibernate.ejb.EntityManagerFactoryImpl$JPACache.contains(EntityManagerFactoryImpl.java:164)
...
{code}
The {{Cache#toMap}} method is optional (according to Javadoc), thus, {{BaseRegionAdapter}} shouldn't rely on this method.
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (HHH-5189) Same table is mapped twice but different primary keys. Giving error while secondPassCompileForeignKeys.
by Sardar Romender Singh (JIRA)
Same table is mapped twice but different primary keys. Giving error while secondPassCompileForeignKeys.
-------------------------------------------------------------------------------------------------------
Key: HHH-5189
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5189
Project: Hibernate Core
Issue Type: Bug
Environment: OS: Linux
DB : Oracle
Hibernate Version : 3.2.5 ga
Reporter: Sardar Romender Singh
Priority: Trivial
Two tables are mapped with different primary keys.
Example :
I have customer table which is mapped to Customer Entity whose primary keys are Customer id and status (which says authorized customer or un authorized customer).
I have one more entity mapped to same table CustomerLight which will load only some specific fields of the customer which contains the where clause which specifies to load only authorized customer.
There are some more entities which are mapped to customer entity with key-many-to-one relationship.
After loading of the mapping file while validation of foriegn key constraints its failing
Foreign key constraint failed "must have same number of columns as the referenced primary key"
This is happening only in some environments not all.
--
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
14 years, 7 months