[Hibernate-JIRA] Created: (HHH-3183) Allow Embeddable and composite-elements to use custom UserType or CompositeUserType types.
by Nate (JIRA)
Allow Embeddable and composite-elements to use custom UserType or CompositeUserType types.
------------------------------------------------------------------------------------------
Key: HHH-3183
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3183
Project: Hibernate3
Issue Type: Improvement
Components: core
Environment: Hibernate-3.2.5, HSQL database, Java 1.6.0_01
Reporter: Nate
Priority: Trivial
I am unable to define a custom type for a value type of a list. I have a List<Foo> and a custom CompositeUserType for Foo. I need to configure Hibernate to use the list with the custom type. The 3.0 DTD for Hibernate does not have a "type" attribute for the composite-element. It only permits the properties to be listed of the element like below.
<list name="foos" table="Foos">
<key column="Parent_ID"/>
<list-index column="ListPosition"/>
<composite-element class="Foo">
<property name="bar" column="Bar"/>
</composite-element>
</list>
What I want is to define a custom type for the composite-element like below.
<list name="foos" table="Foos">
<key column="Parent_ID"/>
<list-index column="ListPosition"/>
<composite-element class="Foo" type="FooCompositeElement"/>
</list>
It would also be nice to have an annotation for Embeddable objects to do the same thing. For example, I can declare an object of type Foo to be Embeddable and also define a custom CompositeUserType for Foo.
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-3180) Handling of columns with database side default values
by Heinz Huber (JIRA)
Handling of columns with database side default values
-----------------------------------------------------
Key: HHH-3180
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3180
Project: Hibernate3
Issue Type: New Feature
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6
Oracle 10i (should not matter)
Reporter: Heinz Huber
Attachments: generated-default.zip
Reload default columns after insert.
Effect: If a component is mapped with generated=default, it will be inserted (unless dynamic-insert and value == null) and then reloaded.
Example:
<class name="Verfueger" table="ELVFGR" dynamic-insert="true" dynamic-update="true" select-before-update="true" optimistic-lock="dirty"
rowid="rowid">
<composite-id name="nummer">
<key-many-to-one name="mandant" column="vfMand" />
<key-property name="anlagekennzeichen" column="vfAkzV" />
<key-property name="nummer" column="vfVfNr" length="6" />
</composite-id>
<property name="sms" column="vfSmsB" generated="default" />
</class>
If property sms has a value, it will be inserted.
If not, the default value will be set by the database.
In both cases, the value is reloaded after the insert.
Extent:
src/org/hibernate/hibernate-mapping-3.0.dtd
src/org/hibernate/mapping/PropertyGeneration.java
src/org/hibernate/tuple/PropertyFactory.java
src/org/hibernate/tuple/entity/EntityMetamodel.java
--
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, 10 months
[Hibernate-JIRA] Commented: (HHH-1123) Cannot put more than 1000 elements in a InExpression
by Aaron Magi (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1123?page=c... ]
Aaron Magi commented on HHH-1123:
---------------------------------
The solutions provided I am assuming they only fix the Oracle issue of maximum 1000 arguments in a list. I created my own solution (similiar to the ones here) but this does not alleviate the problem for SQL Server "Prepared or callable statement has more than 2000 parameter markers," when there are more than 2000 arguments in the combined lists.
Does anyone have a solution for this or is it a SQL Server problem which no temporary work around? I can not have multiple queries and gather the results in the end because we are selecting a sorted subset and need to gather this from the entire set in one query.
> Cannot put more than 1000 elements in a InExpression
> ----------------------------------------------------
>
> Key: HHH-1123
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1123
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 rc2, 3.2.0.alpha1
> Environment: Oracle 9i
> Reporter: Alexis Seigneurin
> Attachments: patch.txt
>
> Original Estimate: 1 hour
> Remaining Estimate: 1 hour
>
> The number of elements that we can put in a "in" expression is limited to a certain amount (1000 for Oracle, for instance). When creating a criteria query, the org.hibernate.criterion.InExpression class should split the expression into several smaller ones.
> Attached is a patch which splits the expression by slices of 500 elements. For example, if we have 1001 elements to put in the "in" expression, the result would be :
> (entity.field in (?, ?, ?...) or entity.field in (?, ?, ?...) or entity.field in (?))
> The surrounding parantheses are useful to avoid problems with other conditions (a "and" condition taking over the one of the "or" conditions).
--
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, 10 months
[Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries
by Shawn Clowater (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Shawn Clowater commented on HHH-530:
------------------------------------
Just included a patch that should allow the 4th test from October to now pass. The original issue that was happening was with the CriteriaImpl that was being stored in the SubqueryExpression and the recursive nature of the toSqlString method.
When the Subquery is built up you pass in a DetachedCriteria and that is stored in the CriteriaImpl parameter. When the query is executed, the first pass to the toSql string is the main executable criteria you are running that already has the session set on it which you can pull off and grab the enabledFilters. However, when it recurses it passes in the stored CriteriaImpl(DetachedCriteria) that doesn't have a session. All the new patch does is set the session of the Criteria coming in onto the CriteriaImpl. As the call recurses the session gets passed along and you can get at the filters.
I'm not sure why I didn't see this before but it took me about 5 minutes to spot it after a co-worker was attempting a nested subquery yesterday. It seems like a relatively safe way to go. If someone could approve/disapprove/suggest refinements I'd love to get this tied off as it's been outstanding for almost 2 years now.
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate3
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.3
>
> Attachments: HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2073) many-to-one join fetch with optional parent causing stray query to fire
by Adam Hardy (JIRA)
many-to-one join fetch with optional parent causing stray query to fire
-----------------------------------------------------------------------
Key: HHH-2073
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2073
Project: Hibernate3
Type: Bug
Reporter: Adam Hardy
Priority: Minor
Attachments: bugtest.zip
I have a call centre application which uses a mature database and is therefore pushing Hibernate to accomplish the mappings I need. The issue here is extra queries that Hibernate is firing where I set up the mapping to do a join in one hit.
I am fetching child objects which may or may not have a parent. The child's foreign key points to a non-primary key on the parent. This is not reflected by a foreign key constraint in the database (hence it allows child to have no parent).
If the child object has the foreign key 0 instead of null, which is the protocol in this database, then the parent which doesn't exist is not (& cannot) be instantiated, no problem, but then after processing the resultset, Hibernate fires off another query to fetch the parent that it could not find data for in the first query.
This is obviously unnecessary in this context and degrades the performance on large searches on this child.
I have classified it as minor since I suspect there may be work-arounds but I have not researched that yet.
I didn't know whether I could put the mapping XML in the query, so I have attached a simplistic testcase example that demonstrates the problem.
The following forum messages are relevant and the latter contains the mappings, which is easier than extracting them out of the testcase zip:
http://forum.hibernate.org/viewtopic.php?t=960522
http://forum.hibernate.org/viewtopic.php?t=964211
--
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, 10 months