[Hibernate-JIRA] Created: (HHH-5637) Allow overridden column names with "table per concrete class" inheritance
by Mark A. Ziesemer (JIRA)
Allow overridden column names with "table per concrete class" inheritance
-------------------------------------------------------------------------
Key: HHH-5637
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5637
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.5.6
Reporter: Mark A. Ziesemer
Per http://docs.jboss.org/hibernate/stable/core/reference/en/html/inheritance... for "Table per concrete class":
{quote}
The limitation of this approach is that if a property is mapped on the superclass, the column name must be the same on all subclass tables.
{quote}
At one point, this documentation also mentioned ([source|http://viewvc.jboss.org/cgi-bin/viewvc.cgi/hibernate/core/trunk/do...]):
{quote}
(We might relax this in a future release of Hibernate.)
{quote}
I've not found a related task for this, so I'm creating this task as a request to support this.
For one use case, I have several related tables that would work very well with polymorphic queries. They have many related columns, but with slightly different column names, e.g. "{{header_id}}" vs. "{{item_header_id}}" (this is arguably poor DB schema design, but is a 3rd party DB that we can't modify). I'm currently able to work with it by using the "implicit polymorphism" alternative. In some cases, I'm using {{@AttributeOverride}}, and in other cases the properties are defined in the parent abstract class as {{@Transient}}, and then overridden in the child concrete classes with the appropriate {{@Column}} annotated per-class.
Unfortunately, without using {{TABLE_PER_CLASS}}, SQL unions are not used. This negatively impacts database performance, and doesn't allow for DB-side ordering and setting a maximum # of results.
When attempting {{TABLE_PER_CLASS}}, Hibernate already generates SQL similar to the following:
{code:SQL}
Select entityId_, field1_, field2_ From (
Select entityId As entityId_, field1 As field1_, field2 As field2_ From table1
Union Select entityId As entityId_, field1 As field1_, field2 As field2_ From table2
);
{code}
Hibernate should allow {{@AttributeOverride}}'s or {{@Column}} annotations on the subclasses to override the column names per table. For example:
{code:SQL}
Select entityId_, field1_, field2_ From (
Select header_id As entityId_, field1 As field1_, field2 As field2_ From table1
Union Select item_header_id As entityId_, field1 As field1_, field2 As field2_ From table2
);
{code}
--
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
13 years, 8 months
[Hibernate-JIRA] Created: (HSEARCH-594) Typos in Hibernate Search documentation
by Emmanuel Bernard (JIRA)
Typos in Hibernate Search documentation
---------------------------------------
Key: HSEARCH-594
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-594
Project: Hibernate Search
Issue Type: Bug
Components: documentation
Affects Versions: 3.3.0.Beta1
Reporter: Emmanuel Bernard
Subject
Typo in Hibernate Search Documentation (HTML, single page)
Message
In section 1.3, there is a typo ("wil" instead of "will") in the
following paragraph:
This leaves us with @IndexedEmbedded. This annotation is used to index
associated entities (@ManyToMany, @*ToOne and @Embedded) as part of
the owning entity. This is needed since a Lucene index document is a
flat data structure which does not know anything about object
relations. To ensure that the authors' name wil be searchable you have
to make sure that the names are indexed as part of the book itself. On
top of @IndexedEmbedded you will also have to mark all fields of the
associated entity you want to have included in the index with
@Indexed. For more details see Section 4.1.3, "Embedded and associated
objects".
--
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
13 years, 8 months