[Hibernate-JIRA] Created: (HV-310) Define, which parts of HV constitute its public API
by Gunnar Morling (JIRA)
Define, which parts of HV constitute its public API
---------------------------------------------------
Key: HV-310
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-310
Project: Hibernate Validator
Issue Type: Improvement
Reporter: Gunnar Morling
Assignee: Hardy Ferentschik
Fix For: 4.1.0
Background:
Mostly users interact only indirectly with Hibernate Validator through the Bean Validation API. But there are also some classes within HV, which are intended to be directly accessed by users (@Email, ResourceBundleMessageInterpolator etc). Right now it is not obvious, which parts (packages, classes) of Hibernate Validator make up this public API.
To do:
* Identify and mark those parts of HV, which constitute its public, user-accessible API. The following rules should apply:
*# It seems useful to let complete packages be part of the API or not (instead of single classes)
*# Non-public packages shouldn't contain public packages
*# Whether a package is public or not should be stated in the package's JavaDoc.
*# The fewer public classes there are, the better, as it will be way harder to modify those in future versions.
* The following packages/classes are candidates for the public API:
** org.hibernate.validator
** org.hibernate.validator.constraints
** org.hibernate.validator.engine.resourceloading (should be moved due to 2.; maybe CachingResourceBundleLocator should be excluded?)
** org.hibernate.validator.engine.ResourceBundleMessageInterpolator (should be moved due to 1.)
* Add a section to the HV ref guide describing the public API. In that context it should be defined and documented, which rules apply to the further development of this API (especially with respect to changes breaking backward-compatibility)
* Modify the HV OSGi manifest in order to export only the public packages
--
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, 5 months
[Hibernate-JIRA] Updated: (HHH-1015) Incorrect SQL generated when one-to-many foreign key is in a discriminated subclass table
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1015?page=c... ]
Gail Badner updated HHH-1015:
-----------------------------
Affects Version/s: 3.5.1
> Incorrect SQL generated when one-to-many foreign key is in a discriminated subclass table
> -----------------------------------------------------------------------------------------
>
> Key: HHH-1015
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1015
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 beta 2, 3.5.1
> Environment: Hibernate versions 3.1 beta 3 and 3.0.5
> Reporter: Steven Grimm
> Priority: Minor
> Attachments: 3.3.2.GA-HHH-1015-v1.patch, hhh-1015-version2.patch, hhh-1015.patch
>
>
> I have the following mappings describing a hierarchy of events and a class that the events refer to:
> <hibernate-mapping package="com.xyz">
> <class name="Event" table="event" discriminator-value="-1">
> <id name="Id" type="long" column="event_id"/>
> <discriminator column="event_type_id" type="integer" />
> <subclass name="EventPayer" discriminator-value="-3">
> <join table="event_payer">
> <key column="event_id" />
> <many-to-one name="payer" column="payer_id" class="Payer" />
> </join>
> <subclass name="EventPayerCreated" discriminator-value="1" />
> </subclass>
> </class>
> <class name="Payer" table="payer">
> <id name="payerId" column="payer_id" type="java.lang.Long"/>
> <set name="eventPayers" inverse="true" cascade="save-update">
> <key column="payer_id"/>
> <one-to-many class="EventPayer"/>
> </set>
> </class>
> </hibernate-mapping>
> When I fetch the Payer.eventPayers collection, Hibernate generates this SQL:
> select eventpayer0_.payer_id as payer7_1_,
> eventpayer0_.event_id as event1_1_,
> eventpayer0_.event_id as event1_5_0_,
> eventpayer0_1_.payer_id as payer2_6_0_,
> eventpayer0_.event_type_id as event2_5_0_
> from event eventpayer0_
> inner join event_payer eventpayer0_1_
> on eventpayer0_.event_id=eventpayer0_1_.event_id
> where eventpayer0_.payer_id=?
> The problem is that there is no event.payer_id column; payer_id is in the child table, not the parent. It appears that specifying a discriminated subclass in <one-to-many> is the same as specifying the superclass, or that Hibernate is ignoring the subclass's <join> element. As far as I can tell, this leaves no way to resolve bidirectional associations where one end of the association is in a discriminated subclass, which seems like a perfectly reasonable thing to want to do.
> I also tried changing <key column="payer_id"/> to <key property-ref="payer"/> in the Payer class's <set> element, but got similar behavior in the form of a "property not found" error: Hibernate is either looking in the superclass's properties rather than the subclass's or is ignoring the list of properties in the <join> element.
--
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, 5 months