[Hibernate] derby support

2006-08-01 Thread Steve Ebersole
I am working on enhancing Derby support a little bit, but have run into
an issue with their syntax that I am unable to figure out.  I was hoping
someone on this list was familiar enough with Derby to point me in the
right direction.

Specifically, I am trying to properly deal with the manner in which
Derby (and also DB2 largely) expects columns to be referenced in certain
clauses.  For example, because Hibernate always aliases columns in the
select clause, derby requires that those aliases be used in certain
later clauses.  The query I am trying to work through right now is as
follows:
select
model0_.name as col_0_0_,
count(*) as col_1_0_ 
from
Model model0_ 
group by
model0_.name 
having
count(*) > 1

However, I get errors from Derby when passing this to the DB:
ERROR 42X04: Column 'MODEL0_.COL_0_0_' is either not in any table in the
FROM list or appears within a join specification and is outside the
scope of the join specification or appears in a HAVING clause and is not
in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then
'MODEL0_.COL_0_0_' is not a column in the target table.

If the having clause is removed, the query parses fine; I have tried
various incantations regarding how to define the having clause without
avail.

This query seems taken almost verbatim from their reference docs, yet I
cannot get this to work...
http://db.apache.org/derby/docs/10.1/ref/rrefselectexpression.html

Any thoughts?

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Session.replicate() into IDENTITY table ?

2006-08-01 Thread Darryl Miles

A while ago I highlighted a problem with the differences between the 
documented API and what Hibernate actually does and I'm seeking to an 
open discussion about the merits and problems to renaming the current 
#replicate() function to #replicateOrSave() to better identify what it 
actually does.

This is so that a hole can be left open to implement a real #replicate() 
function which makes contact guarantees that the primary key / OID will 
be identical even in IDENTITY tables in the replicated object or 
otherwise it throws an exception.  There should also be a feature 
enquiry function to allow the API programmer to ask the underlying 
Hibernate implementation to verify if a replication on identity table 
will work.  This would account for JDBC driver vendors and versions and 
the realtime SQL database server vendor and version.

http://www.mail-archive.com/hibernate-devel@lists.sourceforge.net/msg05230.html
http://forum.hibernate.org/viewtopic.php?t=949574&highlight=
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html#replicate(java.lang.Object,%20org.hibernate.ReplicationMode)

RFC

Darryl


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] [hibernate-dev] derby support

2006-08-01 Thread Emmanuel Bernard
https://issues.apache.org/jira/browse/DERBY-1624

and also regarding some decent JPA certification
https://issues.apache.org/jira/browse/DERBY-1623

There are probably other limitations hidden

Steve Ebersole wrote:
> I am working on enhancing Derby support a little bit, but have run into
> an issue with their syntax that I am unable to figure out.  I was hoping
> someone on this list was familiar enough with Derby to point me in the
> right direction.
>
> Specifically, I am trying to properly deal with the manner in which
> Derby (and also DB2 largely) expects columns to be referenced in certain
> clauses.  For example, because Hibernate always aliases columns in the
> select clause, derby requires that those aliases be used in certain
> later clauses.  The query I am trying to work through right now is as
> follows:
> select
> model0_.name as col_0_0_,
> count(*) as col_1_0_ 
> from
> Model model0_ 
> group by
> model0_.name 
> having
> count(*) > 1
>
> However, I get errors from Derby when passing this to the DB:
> ERROR 42X04: Column 'MODEL0_.COL_0_0_' is either not in any table in the
> FROM list or appears within a join specification and is outside the
> scope of the join specification or appears in a HAVING clause and is not
> in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then
> 'MODEL0_.COL_0_0_' is not a column in the target table.
>
> If the having clause is removed, the query parses fine; I have tried
> various incantations regarding how to define the having clause without
> avail.
>
> This query seems taken almost verbatim from their reference docs, yet I
> cannot get this to work...
> http://db.apache.org/derby/docs/10.1/ref/rrefselectexpression.html
>
> Any thoughts?
>
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
>   

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel