[Hibernate-JIRA] Commented: (HBX-524) Reverse of one-to-one relationships
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-524?page=co... ]
Max Rydahl Andersen commented on HBX-524:
-----------------------------------------
Related jboss tools issue: https://jira.jboss.org/jira/browse/JBIDE-3270
> Reverse of one-to-one relationships
> -----------------------------------
>
> Key: HBX-524
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-524
> Project: Hibernate Tools
> Issue Type: Bug
> Components: reverse-engineer
> Affects Versions: 3.1beta2
> Environment: HIbernate 3.1, Oracle 9i
> Reporter: Andrea Cattani
> Assignee: Anthony Patricio
> Fix For: 3.2.4.CR1
>
> Attachments: HBX-524.patch, HBX-524v2.patch, one-to-one-marcio.patch, patch.txt
>
>
> Hi,
> I've posted this issue to the forum and got this response from Max, Hibernate Team:
> "the reveng tools does not detect this as a one-to-one. it probably could, so add a request/patch to jira."
> The problem I've faced is the following:
> I have two tables, let's say
> - table A with column ID (PK) and other fields
> - table B with column ID (PK) and other fields
> table B has a foreign key constraint against table A, from column ID to column ID (one-to-one)
> When I reverese the tables with the HibernateTools I have such a resultant mapping for table B:
> <class name="B" table="B" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned" />
> </id>
> <[b]many-to-one name[/b]="a" class="A" update="false" insert="false" fetch="select">
> <column name="ID" length="12" not-null="true" unique="true" />
> </many-to-one>
> ....
> And this one for table A:
> <class name="A" table="A" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned"/>
> </id>
> <set name="b" inverse="true">
> <key>
> <column name="ID" length="12" not-null="true" unique="true" />
> </key>
> <[b]one-to-many[/b] class="B" />
> </set>
> </class>
> while I was expecting something like:
> [i]<one-to-one name="a" class="A" constrained="true"/>[/i]
> in table B, and the same (or nothing) in table A
> Thank you
> Andi
--
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, 1 month
[Hibernate-JIRA] Commented: (HBX-524) Reverse of one-to-one relationships
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-524?page=co... ]
Max Rydahl Andersen commented on HBX-524:
-----------------------------------------
Because we didn't get the ui in place - i'm working on that.
> Reverse of one-to-one relationships
> -----------------------------------
>
> Key: HBX-524
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-524
> Project: Hibernate Tools
> Issue Type: Bug
> Components: reverse-engineer
> Affects Versions: 3.1beta2
> Environment: HIbernate 3.1, Oracle 9i
> Reporter: Andrea Cattani
> Assignee: Anthony Patricio
> Fix For: 3.2.4.CR1
>
> Attachments: HBX-524.patch, HBX-524v2.patch, one-to-one-marcio.patch, patch.txt
>
>
> Hi,
> I've posted this issue to the forum and got this response from Max, Hibernate Team:
> "the reveng tools does not detect this as a one-to-one. it probably could, so add a request/patch to jira."
> The problem I've faced is the following:
> I have two tables, let's say
> - table A with column ID (PK) and other fields
> - table B with column ID (PK) and other fields
> table B has a foreign key constraint against table A, from column ID to column ID (one-to-one)
> When I reverese the tables with the HibernateTools I have such a resultant mapping for table B:
> <class name="B" table="B" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned" />
> </id>
> <[b]many-to-one name[/b]="a" class="A" update="false" insert="false" fetch="select">
> <column name="ID" length="12" not-null="true" unique="true" />
> </many-to-one>
> ....
> And this one for table A:
> <class name="A" table="A" schema="SCHEMA">
> <id name="id" type="string">
> <column name="ID" length="12" />
> <generator class="assigned"/>
> </id>
> <set name="b" inverse="true">
> <key>
> <column name="ID" length="12" not-null="true" unique="true" />
> </key>
> <[b]one-to-many[/b] class="B" />
> </set>
> </class>
> while I was expecting something like:
> [i]<one-to-one name="a" class="A" constrained="true"/>[/i]
> in table B, and the same (or nothing) in table A
> Thank you
> Andi
--
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, 1 month
[Hibernate-JIRA] Created: (ANN-688) Repeated columns created for single table inheritance
by Nick Heudecker (JIRA)
Repeated columns created for single table inheritance
-----------------------------------------------------
Key: ANN-688
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-688
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.0.ga
Environment: Hibernate 3.2.5ga, Postgresql
Reporter: Nick Heudecker
I have the following classes:
@Entity
@Inheritance(strategy= InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="cltype", discriminatorType= DiscriminatorType.STRING, length=10)
@DiscriminatorValue("device")
public abstract class Device extends AbstractPersistent {
private System system;
@ManyToOne
public System getSystem() {
return system;
}
public void setSystem(System system) {
this.system = system;
}
}
@Entity
@DiscriminatorValue("snmp")
public class SnmpDevice extends Device {
// .... additional properties defined
}
When I try to create the SessionFactory, I'm getting the following exception:
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: model.SnmpDevice column: system_uuid (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:652)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:674)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:696)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:450)
at org.hibernate.mapping.SingleTableSubclass.validate(SingleTableSubclass.java:43)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-3618) Lack of documentation of the method Interceptor.onCollectionUpdate
by Ed Bras (JIRA)
Lack of documentation of the method Interceptor.onCollectionUpdate
------------------------------------------------------------------
Key: HHH-3618
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3618
Project: Hibernate Core
Issue Type: Bug
Components: documentation
Affects Versions: 3.3.1
Environment: n.a.
Reporter: Ed Bras
A few verions ago the new method Interceptor.onCollectionUpdate was introduced, which could be very nice to do "something" just before value type objects are flushed. However, the usage is totaly unclear and till today no documentation is available.
Also in the forum, nobody seems to really know how it should be used, and there is confusion about his usage in the forum.
It would be very nice if somebody of the development team would take 5 minutes to right this down with a few examples. At least developers can then really make use of it.
In my case I need to update a date of value type objects that are stored in a set that is cascaded updated due to an update call on his entity.
For example: Entity: member that has a set of status history objects (value types).
But I have no idea how to do this correctly without too much performance impact, even not after debugging the call to 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
16 years, 1 month
[Hibernate-JIRA] Created: (HHH-3617) Using Query (Object) ocurr violates foreign key in transaction
by Clayton K. N. Passos (JIRA)
Using Query (Object) ocurr violates foreign key in transaction
--------------------------------------------------------------
Key: HHH-3617
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3617
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: "PostgreSQL 8.2.5 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)"
Hibernate core 3.3.1 and the only required library
Reporter: Clayton K. N. Passos
Attachments: Car.hbm.xml, MainTest.java, Travel.hbm.xml
Using Query (Object) ocurr violates foreign key in transaction
Look MainTest and Query object:
Query query = session.createQuery(sb.toString());
int row = query.executeUpdate();
I expect that the behavior be the even though Session.delete(...), but it´s not true.
The exception occurs below:
Exception in thread "main" org.hibernate.exception.ConstraintViolationException: could not execute update query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:107)
at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:419)
at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:283)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1168)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:117)
at com.MainTest.main(MainTest.java:54)
Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "car" violates foreign key constraint "fk95cb6b3a78a8fea5" on table "travel"
Detalhe: Key (idcar)=(1) is still referenced from table "travel".
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1548)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1316)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:191)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305)
at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:98)
--
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, 1 month