I'd like to setup a multi-column unique constraint, which i'd normally be
able to do with the unique-key attribute in a column element:
<column name="FirstName" unique-key="PersonFirstLastName"/>
<property name="LastName" >
<column name="LastName" unique-key="PersonFirstLastName"/>
but if I want to have a many-to-one element, unique-key is not listed as one
of the available attributes.
<column name="IsLeadDeveloper" unique-key="GroupLeadDeveloper"/>
<property name="Group" >
<many-to-one name="GroupID" unique-key="GroupLeadDeveloper"/>
I'm working with CastleProject/ActiveRecord, and submitted a JIRA issue to
the project, but they suggested that Hibernate does not support this and
that I should post a JIRA issue here. Just want to verify that I'm not
taking the wrong approach before I post it to JIRA.
Brian Stansberry wrote:
> Sent this out a while back, but the conf call didn't come off due to
> scheduling issues. Time to try again.
> How does next Monday, Feb 26 at 10:00 AM EST sound? Once we have an
> agreed time I'll send out conference call details. Those cc'ed on the
> mailing lists are welcome to join in.
Also including Owen explicitly, since I am not sure if he is part of
That date/time is fine for me.
When querying for a list of objects using ejb-ql, the keyword 'distinct'
is used to de-duplicate the result set and give a correct list of
objects. However I have noticed that everytime distinct is specifed in
the ejb-ql query it also gets specified in the sql query. I am curious
as the reasoning behind this. I understand that distinct is used to
remove duplicates from the SQL result set, but from what I can see, for
the majority of simple use cases the sql distinct is superflous.
Running the hibernate generated query without the distinct returns the
same results. I assume that the distinct is in there for are reason,
are there some more complicated use cases for which the distinct in
My main concern is performance, is there anyway of performing an ejb-ql
"select distinct..." without hibernate issuing an sql "select distinct...".