[Hibernate] Doc TODOs

2005-01-28 Thread Christian Bauer
I've been catching up with the H3 doco this week. It would be great if 
all committers would immediately add a TODO in the right section in 
the reference when they implement a feature. I might not catch all of 
them by looking around commit logs and JIRA. A short sentence 
describing the new feature would also make writing about it a lot 
easier :) You don't have to care about revisions as long as its only a 
TODO.

Thanks
--
Christian Bauer
callto://christian-bauer
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com 


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] criteria enhancements and some refactorings...

2005-01-28 Thread Max Rydahl Andersen
Hi guys,
Ok, i've now committed my addons on Gavins great work on the projection  
API in Criteria.

I have added a ToBeanResultTransformer which makes it possible to do stuff  
like:

public class StudentDTO {
...
public String courseDescription;
public String setStudentName(String sn) { .. };
}
List resultWithAliasedBean = s.createCriteria(Enrolment.class)
			.createAlias(student, st)
			.createAlias(course, co)
			.setProjection( Expression.projection()
	.add( Expression.property(st.name), studentName )
	.add( Expression.property(co.description), courseDescription )
			).setResultTransformer(new  
AliasToBeanResultTransformer(StudentDTO.class))
			.list();

And the result will contain instances of StudentDTO (this is similar to  
the concept of setResultClass() in e.g. JDO2)
Note: This also works for non-projection queries.

There is one caveat with having resulttransformers on projection and that  
is
Criteria defaults to use Criteria.ROOT_ENTITY as transformer and this  
result
in just being returned the first element of a possible projection.

Should we automatically set Criteria.PROJECTION_RESULT as  
resulttransformer when calling setProjection ?
Or should the user explicitly state what she wants ?

--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Criteria curiosity...

2005-01-28 Thread Max Rydahl Andersen
Hi,
while working on Critiera i bumped into this funny behavior:
Doing the following Critieria on an empty db gives no error:
s.createCriteria(Student.class)
.add( Expression.like(name, Gavin, MatchMode.START) 
)
.addOrder( Order.asc(name) )
.createCriteria(enrolments, e)
.addOrder( Order.desc(year) )
.addOrder( Order.desc(semester) )
.createCriteria(course)
.addOrder( Order.asc(description) )
.setProjection( Expression.projection()
.add( Expression.property(this.name) )
.add( Expression.property(e.year) )
.add( Expression.property(e.semester) 
)
.add( Expression.property(courseCode) 
)
.add( 
Expression.property(description) )
)
.uniqueResult();
but when data is available i get an error saying
that courseCode is not available on Student - which is totally correct.  
(using explicit criteria aliases solves it)

I'm just wondering why this is not discovered when the query gives no  
result - it should still be able to tell
that courseCode is not on Student - is this expected behavior ?

--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Sequence query on Postgresql

2005-01-28 Thread Patrick Burleson
I opened two JIRA requests regarding sequence selects (with provided
patches) for the Postgresql Dialect. They have both been closed, with
only Hibernate 3 getting the fix.

Gavin closed the Hibernate 2 one after he added the sequence queries
to a bunch of dialects. Then Michael Gloegl closed the Hibernate 3 one
noticing Gavin had already done the fix.

I just don't want the fix for Hibernate 2 to fall through the cracks.
It would be really nice to see this in 2.1.8 as it will put to an end
all the problems I have with SchemaUpdate on Postgresql.

The issues in question are:

http://opensource.atlassian.com/projects/hibernate/browse/HHH-95

and 

http://opensource.atlassian.com/projects/hibernate/browse/HB-1390

Thanks,
Patrick


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] criteria enhancements and some refactorings...

2005-01-28 Thread Max Rydahl Andersen
On Fri, 28 Jan 2005 14:59:59 -0600, Gavin King [EMAIL PROTECTED]  
wrote:

Yes, probably - I already knew about that wrinkle
ok - so i should do a forced set of transformer in setProjection.
Alternatively, I'm wondering if the notion of a Projection should
Be unified with the notion of a ResultTransformer. So, eg, there is
Projection.getResultTransformer.
hmm - don't follow you on this ?
what would be it's purpose ?
/max
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Max
Rydahl Andersen
Sent: Saturday, 29 January 2005 2:03 AM
To: Hibernate development
Subject: [Hibernate] criteria enhancements and some refactorings...
Should we automatically set Criteria.PROJECTION_RESULT as
resulttransformer when calling setProjection ?
Or should the user explicitly state what she wants ?

--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] Criteria curiosity...

2005-01-28 Thread Steve Ebersole
Not sure which DB you are using, but for example I've noticed that HSQL
seems to not parse the entire statement string upfront which can lead to
issue like this.  It leaves parsing certain pieces relative to its
internal working datasets; if there are no results in those working
sets, you get no errors.  Specifically I have seen this with correlated
sub-queries.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Max
Rydahl Andersen
Sent: Friday, January 28, 2005 9:56 AM
To: Hibernate development
Subject: [Hibernate] Criteria curiosity...

Hi,

while working on Critiera i bumped into this funny behavior:

Doing the following Critieria on an empty db gives no error:

s.createCriteria(Student.class)
.add( Expression.like(name, Gavin,
MatchMode.START) )
.addOrder( Order.asc(name) )
.createCriteria(enrolments, e)
.addOrder( Order.desc(year) )
.addOrder( Order.desc(semester) )
.createCriteria(course)
.addOrder( Order.asc(description) )
.setProjection( Expression.projection()
.add(
Expression.property(this.name) )
.add(
Expression.property(e.year) )
.add(
Expression.property(e.semester) )
.add(
Expression.property(courseCode) )
.add(
Expression.property(description) )
)
.uniqueResult();

but when data is available i get an error saying
that courseCode is not available on Student - which is totally correct.

(using explicit criteria aliases solves it)

I'm just wondering why this is not discovered when the query gives no  
result - it should still be able to tell
that courseCode is not on Student - is this expected behavior ?

-- 
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]
http://jboss.com


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] Criteria curiosity...

2005-01-28 Thread Steve Ebersole
Sorry, since you did not explicitly say, just assumed you meant a db
error.

Can't tell you why this breaks as I have not looked at that projection
stuff.  I would guess that it is not *properly* resolving the return
types until there is actually a result set.

-Original Message-
From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 28, 2005 2:30 PM
To: Steve Ebersole; Hibernate development
Subject: Re: [Hibernate] Criteria curiosity...


but this check is something hibernate generates. its not db dependent  
AFAIK.


 Not sure which DB you are using, but for example I've noticed that
HSQL
 seems to not parse the entire statement string upfront which can lead
to
 issue like this.  It leaves parsing certain pieces relative to its
 internal working datasets; if there are no results in those working
 sets, you get no errors.  Specifically I have seen this with
correlated
 sub-queries.


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Max
 Rydahl Andersen
 Sent: Friday, January 28, 2005 9:56 AM
 To: Hibernate development
 Subject: [Hibernate] Criteria curiosity...

 Hi,

 while working on Critiera i bumped into this funny behavior:

 Doing the following Critieria on an empty db gives no error:

 s.createCriteria(Student.class)
   .add( Expression.like(name, Gavin,
 MatchMode.START) )
   .addOrder( Order.asc(name) )
   .createCriteria(enrolments, e)
   .addOrder( Order.desc(year) )
   .addOrder( Order.desc(semester) )
   .createCriteria(course)
   .addOrder( Order.asc(description) )
   .setProjection( Expression.projection()
   .add(
 Expression.property(this.name) )
   .add(
 Expression.property(e.year) )
   .add(
 Expression.property(e.semester) )
   .add(
 Expression.property(courseCode) )
   .add(
 Expression.property(description) )
   )
   .uniqueResult();

 but when data is available i get an error saying
 that courseCode is not available on Student - which is totally
correct.

 (using explicit criteria aliases solves it)

 I'm just wondering why this is not discovered when the query gives no
 result - it should still be able to tell
 that courseCode is not on Student - is this expected behavior ?




-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Criteria curiosity...

2005-01-28 Thread Max Rydahl Andersen
Can't tell you why this breaks as I have not looked at that projection
stuff.  I would guess that it is not *properly* resolving the return
types until there is actually a result set.
yes got that, but i was just wondering if this is expected/wanted behavior.
/max
-Original Message-
From: Max Rydahl Andersen [mailto:[EMAIL PROTECTED]
Sent: Friday, January 28, 2005 2:30 PM
To: Steve Ebersole; Hibernate development
Subject: Re: [Hibernate] Criteria curiosity...
but this check is something hibernate generates. its not db dependent
AFAIK.

Not sure which DB you are using, but for example I've noticed that
HSQL
seems to not parse the entire statement string upfront which can lead
to
issue like this.  It leaves parsing certain pieces relative to its
internal working datasets; if there are no results in those working
sets, you get no errors.  Specifically I have seen this with
correlated
sub-queries.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Max
Rydahl Andersen
Sent: Friday, January 28, 2005 9:56 AM
To: Hibernate development
Subject: [Hibernate] Criteria curiosity...
Hi,
while working on Critiera i bumped into this funny behavior:
Doing the following Critieria on an empty db gives no error:
s.createCriteria(Student.class)
.add( Expression.like(name, Gavin,
MatchMode.START) )
.addOrder( Order.asc(name) )
.createCriteria(enrolments, e)
.addOrder( Order.desc(year) )
.addOrder( Order.desc(semester) )
.createCriteria(course)
.addOrder( Order.asc(description) )
.setProjection( Expression.projection()
.add(
Expression.property(this.name) )
.add(
Expression.property(e.year) )
.add(
Expression.property(e.semester) )
.add(
Expression.property(courseCode) )
.add(
Expression.property(description) )
)
.uniqueResult();
but when data is available i get an error saying
that courseCode is not available on Student - which is totally
correct.
(using explicit criteria aliases solves it)
I'm just wondering why this is not discovered when the query gives no
result - it should still be able to tell
that courseCode is not on Student - is this expected behavior ?



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Criteria curiosity...

2005-01-28 Thread Gavin King
I guess this is the database, not us
Max Rydahl Andersen wrote:
Hi,
while working on Critiera i bumped into this funny behavior:
Doing the following Critieria on an empty db gives no error:
s.createCriteria(Student.class)
.add( Expression.like(name, Gavin, MatchMode.START) )
.addOrder( Order.asc(name) )
.createCriteria(enrolments, e)
.addOrder( Order.desc(year) )
.addOrder( Order.desc(semester) )
.createCriteria(course)
.addOrder( Order.asc(description) )
.setProjection( Expression.projection()
.add( Expression.property(this.name) )
.add( Expression.property(e.year) )
.add( Expression.property(e.semester) )
.add( Expression.property(courseCode) )
.add( Expression.property(description) )
)
.uniqueResult();
but when data is available i get an error saying
that courseCode is not available on Student - which is totally 
correct.  (using explicit criteria aliases solves it)

I'm just wondering why this is not discovered when the query gives no  
result - it should still be able to tell
that courseCode is not on Student - is this expected behavior ?


--
Gavin King
+61 410 534 454
+1 404 822 8349
callto://gavinking
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com

---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Criteria curiosity...

2005-01-28 Thread Max Rydahl Andersen
but this check is something hibernate generates. its not db dependent  
AFAIK.


Not sure which DB you are using, but for example I've noticed that HSQL
seems to not parse the entire statement string upfront which can lead to
issue like this.  It leaves parsing certain pieces relative to its
internal working datasets; if there are no results in those working
sets, you get no errors.  Specifically I have seen this with correlated
sub-queries.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Max
Rydahl Andersen
Sent: Friday, January 28, 2005 9:56 AM
To: Hibernate development
Subject: [Hibernate] Criteria curiosity...
Hi,
while working on Critiera i bumped into this funny behavior:
Doing the following Critieria on an empty db gives no error:
s.createCriteria(Student.class)
.add( Expression.like(name, Gavin,
MatchMode.START) )
.addOrder( Order.asc(name) )
.createCriteria(enrolments, e)
.addOrder( Order.desc(year) )
.addOrder( Order.desc(semester) )
.createCriteria(course)
.addOrder( Order.asc(description) )
.setProjection( Expression.projection()
.add(
Expression.property(this.name) )
.add(
Expression.property(e.year) )
.add(
Expression.property(e.semester) )
.add(
Expression.property(courseCode) )
.add(
Expression.property(description) )
)
.uniqueResult();
but when data is available i get an error saying
that courseCode is not available on Student - which is totally correct.
(using explicit criteria aliases solves it)
I'm just wondering why this is not discovered when the query gives no
result - it should still be able to tell
that courseCode is not on Student - is this expected behavior ?

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
---
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag--drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel