[Hibernate-JIRA] Created: (ANN-636) Add the annotations to map the User Collection Type
by jason (JIRA)
Add the annotations to map the User Collection Type
---------------------------------------------------
Key: ANN-636
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-636
Project: Hibernate Annotations
Issue Type: New Feature
Components: binder
Environment: n/a
Reporter: jason
I am searching a way from the Hibernate Annotation to map the user defined collection, and find out the following :
Can anybody let me know what the status for this? or how i can map the user collection type by hibernate annotation, thanks
Add an annotation to specify the UserCollectionType for a OneToMany or ManyToMany.
The annotation is named CollectionTypeInfo, perhaps better named UserCollectionType, but I didn't know the standards for naming classes.
The change to AnnotationBinder is minor and is delineated by '//dwsjoquist//' comment lines.
Usage:
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "id")
@CollectionTypeInfo(name = "examples.MyUserCollectionType")
public List<ExampleAttribute> getExampleAttributes() {
--
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-2787) Criteria Aggregate Projections do not JOIN additional tables on which restrictions apply
by Sami Dalouche (JIRA)
Criteria Aggregate Projections do not JOIN additional tables on which restrictions apply
----------------------------------------------------------------------------------------
Key: HHH-2787
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2787
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.5
Environment: PostgreSQL Dialect
Reporter: Sami Dalouche
Priority: Critical
Hi,
When you have a Criteria Object, on which you :
- Add Aggregate Projections such as rowCount()
- createAlias("whatever").add(Restrictions.*..)
It looks like that the "whatever" table is NOT joined, even though it is joined OK when the projections are not there.
So, here is an approximate Unit test that should throw an exception (I couldn't create a complete test case since I couldn't get the unit tests to run on my machine -any link explaining this step somewhere ?):
Criteria c1 = s.createCriteria(Enrolment.class)
.setProjection( Projections.projectionList().add(Projections.rowCount(), "rowCount") );
Criteria studentCriteria = c1.createAlias("student", "st");
studentCriteria.add(Restrictions.eq("name", "whatevername"));
It should complain saying the "st.name" alias does not exist, because the student class has not been joined.
Regards,
Sami Dalouche
--
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-2546) fetch="select" doesn't work when there are no mapped columns in joined except <key
by Derar Bakr (JIRA)
fetch="select" doesn't work when there are no mapped columns in joined except <key
----------------------------------------------------------------------------------
Key: HHH-2546
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2546
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: Windows XP Pro
Reporter: Derar Bakr
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.String.substring(String.java:1768)
at java.lang.String.substring(String.java:1735)
at org.hibernate.persister.entity.AbstractEntityPersister.renderSelect(AbstractEntityPersister.java:2899)
at org.hibernate.persister.entity.SingleTableEntityPersister.generateSequentialSelect(SingleTableEntityPersister.java:647)
at org.hibernate.persister.entity.SingleTableEntityPersister.postInstantiate(SingleTableEntityPersister.java:696)
....
Everything is very simple.
There is stupid code in SelectFragment class, method toFragmentString, line 94. String that is being created there, contains list of fields, like a "f1, f2, f3, ..., fn".
", " is being added in every iteration, without check for it is first iteration.
And in class AbstractEntityPersister., method renderSelect, line 2899, where that method is called, this first ", " is deleted using substring(2). So no check for empty string.
I suggest to add check :)))
I just create dynamic mappings programmatically, so create empty join subclass mappings - and in created table there are no fields by default except foreing key.
--
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, 2 months