[Hibernate-JIRA] Commented: (ANN-391) SecondaryTables not recognized when using JOINED inheritance
by Sebastian Kirsch (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-391?page=co... ]
Sebastian Kirsch commented on ANN-391:
--------------------------------------
Hi Andreas!
Not sure if it is applicable for your situation; but maybe this helps:
I switched to single-table inheritance (with a discriminator column), defining all properties introduced by the extended classes as located in a secondary table. Although it seems odd - for the single-table inheritance, using secondary tables actually works. You can even define a "subsub"class with another "secondary" table.
The result is pretty much the same (even in SQL I guess) like using joined inheritance.
Defining two secondary tables in one class should not cause any trouble (which would probably solve your issue).
> SecondaryTables not recognized when using JOINED inheritance
> ------------------------------------------------------------
>
> Key: ANN-391
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-391
> Project: Hibernate Annotations
> Issue Type: Bug
> Affects Versions: 3.1.0.Beta10, 3.2.0.cr1
> Environment: Hibernate 3.2.0CR1; db is irrelevant, as the buildSessionFactory() fails.
> Reporter: Sebastian Kirsch
> Attachments: TestSecondaries.java, TestSecondaries.java
>
>
> The Configuration doesn't recognize secondary tables of a super class.
> Calling AnnotationConfiguration.buildSessionFactory fails, claiming that the secondary table used in the super class cannot be found in the subclass.
> Adding the secondary table to the subclass doesn't help either.
> See attached JUnit test case.
--
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
18 years, 6 months
[Hibernate-JIRA] Commented: (ANN-391) SecondaryTables not recognized when using JOINED inheritance
by Andreas Pakulat (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-391?page=co... ]
Andreas Pakulat commented on ANN-391:
-------------------------------------
I actually meant joined-subclass when I said table-per-class. Also I don't consider SINGLE_TABLE+secondary-table a full workaround, because I can't put many-to-one relationship columns into the secondary table. So I'm stuck with a complete mixture, some relational attributes (like the foreign-key-column for relationships) have to stay in the class-hierarchy-table and some others are going to a secondary table (this is needed to have attributes in the subclass that are non-nullable).
> SecondaryTables not recognized when using JOINED inheritance
> ------------------------------------------------------------
>
> Key: ANN-391
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-391
> Project: Hibernate Annotations
> Issue Type: Bug
> Affects Versions: 3.1.0.Beta10, 3.2.0.cr1
> Environment: Hibernate 3.2.0CR1; db is irrelevant, as the buildSessionFactory() fails.
> Reporter: Sebastian Kirsch
> Attachments: TestSecondaries.java, TestSecondaries.java
>
>
> The Configuration doesn't recognize secondary tables of a super class.
> Calling AnnotationConfiguration.buildSessionFactory fails, claiming that the secondary table used in the super class cannot be found in the subclass.
> Adding the secondary table to the subclass doesn't help either.
> See attached JUnit test case.
--
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
18 years, 6 months
[Hibernate-JIRA] Commented: (HHH-1296) Non lazy loaded List updates done in wrong order, cause exception
by James Ots (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296?page=c... ]
James Ots commented on HHH-1296:
--------------------------------
This is also occurring in Hibernate 3.2.4SP1. Can the patch get applied?
> Non lazy loaded List updates done in wrong order, cause exception
> -----------------------------------------------------------------
>
> Key: HHH-1296
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5
> Environment: Hibernate 3.0.5 - any database (checked postgres 7/8, mysql 4 & 5, db2 v8)
> NOT using lazy loading - the tx's are wrapped by session beans, so lazy loading is not allowed.
> Reporter: David Birch
> Priority: Critical
> Attachments: listupdate_patch.txt, listupdate_patch.txt, listupdate_testcase.zip
>
>
> The logic behind list updates is not quite right, nor was it in v2 (only now i have a DBA who won't let up...)
> The scenario is:
> a bean with list property, and the list has a number of items in it (say 4, index 0-3), an item is then removed (say item at index 2), and the bean is requested to be saved.
> From what i can see in the SQL traces, the same statements are issues whe lazy loading is on or off, they are:
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: delete from TGE_CLIENT_POLICY where CLIENT_ID=? and POSITION=?
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: update TGE_CLIENT_POLICY set POLICY_NK=? where CLIENT_ID=? and POSITION=?
> So, i can only assume (as when this fails, the row with index 1 above the removed row is nuked!), hibernate removes the item at index 3, and then copies the value of the item at index 3 onto the row for item at index 2. Fair enough but...
> When i have lazy loading off, i get DB exceptions like
> Duplicate key or integrity constraint violation message from server: "Duplicate entry '1-999999' for key 1"
> so, there is some nasty in there, which is not updating the correct row - this has happened since 2.1.8 that i know of :(
> i will try & look @ the source, but won't get a chance until after xmas...
--
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
18 years, 6 months
[Hibernate-JIRA] Created: (EJB-298) org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
by Nicholas Albion (JIRA)
org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
----------------------------------------------------------------------
Key: EJB-298
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-298
Project: Hibernate Entity Manager
Issue Type: Improvement
Components: EntityManager
Environment: JBoss 4.2.0GA, MySQL
Reporter: Nicholas Albion
I'm working with Spatial SQL types and I suspect this has something to do with my problem, but I'm going to have to figure it out the hard way as Hibernate's exception does not provide very useful feedback.
Stacktrace:
#20:26:45,448 ERROR [SchemaUpdate] could not complete schema update
#org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
# at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
# at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
# at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:290)
# at org.hibernate.mapping.Column.getSqlType(Column.java:182)
# at org.hibernate.mapping.Table.sqlAlterStrings(Table.java:289)
# at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:966)
# at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:140)
# at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
# at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
# at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
# at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
# at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
# at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
--
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
18 years, 6 months