[Fwd: Re: [Hibernate] HQL 3.1]

2005-03-29 Thread Emmanuel Bernard

 Original Message 
Subject:Re: [Hibernate] HQL 3.1
Date:   Tue, 29 Mar 2005 14:29:00 +0200
From:   Mario Ivankovits <[EMAIL PROTECTED]>
To: Emmanuel Bernard <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

Emmanuel Bernard wrote:
- instanceof is cool, but casting is more useful
where  ( p instanceof Cheque and ((Cheque) p).paperType = :paperType) 
or (p instanceof CreditCard and ((CreditCard) p).pinCode)
In this case I would prefer not to have to cast at all, thus
where  ( p instanceof Cheque and p.paperType = :paperType) or (p 
instanceof CreditCard and p.pinCode)

should be enough.
And if one write
where  p.paperType = :paperType
and p isnt of type Cheque (or to be more concrete, do not have a 
property named paperType) simply throw a PropertyNotFound exception.

---
Mario

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] HQL 3.1

2005-03-29 Thread Emmanuel Bernard
- Add composite id =
- on is more SQL thus less intrusive
- instanceof is cool, but casting is more useful
where  ( p instanceof Cheque and ((Cheque) p).paperType = :paperType) or 
(p instanceof CreditCard and ((CreditCard) p).pinCode)

Gavin King wrote:
One of the main reasons we migrated to the new query parser was to 
allow for easier extension of HQL. We didn't actually make much in the 
way of HQL extensions in 3.0 (except for UPDATE/DELETE, CASE and 
EJB-QL functions). I've been wondering what new cool stuff we could 
consider for 3.1.

First, we need to add a way to add extra conditions to outer joins. Eg:
  from Order ord
 left join ord.lines line on line.deleted is false
  where ...
But perhaps "on" is the wrong keyword, since it is an "extra" join 
condition. Perhaps "filter by"?

  from Order ord
 left join ord.lines line filter by line.deleted is false
  where ...
I'm not sure.
Next, it's about time we had a reliable instanceof operator:
  from Payment p
  where p instanceof Cheque
 or 
Next, I'm considering adding more query-level control over fetching 
strategies

  from Order ord
 subselect fetch ord.lines
  from Order ord
 select fetch ord.lines
  from Order ord
 batch fetch ord.lines
  from Order ord
 batch size 10 fetch ord.lines
Finally, we need to grapple with the problem of supporting expressions 
in the select clause.

Do you think we could and should support the ANSI SQL style periods 
and temporal operators (overlaps, during, before, after, etc.) in a 
portable way?

  from Contract c where [c.effectiveStartDate, c.effectiveEndDate] 
overlaps (:start, :end]

(Unfortunately, Java has no Period or Interval class that we could 
create a standard Hibernate Type for.)

Any other ideas?


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] HQL 3.1

2005-03-28 Thread Max Rydahl Andersen
Lets get aliasing in there too
select p.name as parentName ...
and either
add get methods to Query (nah)
or
add ResultTransformer support to Query results.
-max
One of the main reasons we migrated to the new query parser was to allow  
for easier extension of HQL. We didn't actually make much in the way of  
HQL extensions in 3.0 (except for UPDATE/DELETE, CASE and EJB-QL  
functions). I've been wondering what new cool stuff we could consider  
for 3.1.

First, we need to add a way to add extra conditions to outer joins. Eg:
   from Order ord
  left join ord.lines line on line.deleted is false
   where ...
But perhaps "on" is the wrong keyword, since it is an "extra" join  
condition. Perhaps "filter by"?

   from Order ord
  left join ord.lines line filter by line.deleted is false
   where ...
I'm not sure.
Next, it's about time we had a reliable instanceof operator:
   from Payment p
   where p instanceof Cheque
  or 
Next, I'm considering adding more query-level control over fetching  
strategies

   from Order ord
  subselect fetch ord.lines
   from Order ord
  select fetch ord.lines
   from Order ord
  batch fetch ord.lines
   from Order ord
  batch size 10 fetch ord.lines
Finally, we need to grapple with the problem of supporting expressions  
in the select clause.

Do you think we could and should support the ANSI SQL style periods and  
temporal operators (overlaps, during, before, after, etc.) in a portable  
way?

   from Contract c where [c.effectiveStartDate, c.effectiveEndDate]  
overlaps (:start, :end]

(Unfortunately, Java has no Period or Interval class that we could  
create a standard Hibernate Type for.)

Any other ideas?


--
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] HQL 3.1

2005-03-28 Thread Mario Ivankovits

Do you think we could and should support the ANSI SQL style periods 
and temporal operators (overlaps, during, before, after, etc.) in a 
portable way?

  from Contract c where [c.effectiveStartDate, c.effectiveEndDate] 
overlaps (:start, :end]

(Unfortunately, Java has no Period or Interval class that we could 
create a standard Hibernate Type for.)
You might find http://joda-time.sourceforge.net/ usefull for this. It 
provides Period and Interval.

---
Mario

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] HQL 3.1

2005-03-28 Thread Gavin King
One of the main reasons we migrated to the new query parser was to allow 
for easier extension of HQL. We didn't actually make much in the way of 
HQL extensions in 3.0 (except for UPDATE/DELETE, CASE and EJB-QL 
functions). I've been wondering what new cool stuff we could consider 
for 3.1.

First, we need to add a way to add extra conditions to outer joins. Eg:
  from Order ord
 left join ord.lines line on line.deleted is false
  where ...
But perhaps "on" is the wrong keyword, since it is an "extra" join 
condition. Perhaps "filter by"?

  from Order ord
 left join ord.lines line filter by line.deleted is false
  where ...
I'm not sure.
Next, it's about time we had a reliable instanceof operator:
  from Payment p
  where p instanceof Cheque
 or 
Next, I'm considering adding more query-level control over fetching 
strategies

  from Order ord
 subselect fetch ord.lines
  from Order ord
 select fetch ord.lines
  from Order ord
 batch fetch ord.lines
  from Order ord
 batch size 10 fetch ord.lines
Finally, we need to grapple with the problem of supporting expressions 
in the select clause.

Do you think we could and should support the ANSI SQL style periods and 
temporal operators (overlaps, during, before, after, etc.) in a portable 
way?

  from Contract c where [c.effectiveStartDate, c.effectiveEndDate] 
overlaps (:start, :end]

(Unfortunately, Java has no Period or Interval class that we could 
create a standard Hibernate Type for.)

Any other ideas?
--
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

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel