Re: joins

2008-05-22 Thread Eric Polino
Yes I've done a fair amount of SQLTemplate stuff. The problem there is that we are supporting both Derby and Postgres and they don't use completely portable SQL syntax. On Thu, May 22, 2008 at 6:00 PM, Hans Poo <[EMAIL PROTECTED]> wrote: > Eric, > > Have you tried with SQLTemplate ? i've found it

Re: joins

2008-05-22 Thread Hans Poo
Eric, Have you tried with SQLTemplate ? i've found it extermely useful, in particular when expressions aren't enough (or my knowledge of them is not enough). This example is for running code and a join with two tables: familia and visita. Returns a list of familias. public List getPers

Re: joins

2008-05-22 Thread Mike Kienenberger
Oops. Sorry about that. You need "." between each path component: Expression exp = ExpressionFactory.matchExp( Reservation.TO_SITE_PROPERTY + "." + Site.TO_SITE_TYPE_PROPERTY + "." + SiteType.TYPE_NAME_PROPERTY,

Re: joins

2008-05-22 Thread Eric Polino
Doesn't work for me. This is a copy of my code. It barks at me with a stack trace I'll place below the code. Expression exp = ExpressionFactory.matchExp( Reservation.TO_SITE_PROPERTY + Site.TO_SITE_TYPE_PROPERTY + SiteType.TYPE_NAME_PRO

Re: joins

2008-05-22 Thread Mike Kienenberger
Expression qualifier = ExpressionFactory.matchExp( Reservation.SITE_RELATIONSHIP_PROPERTY + Site.SITE_TYPE_RELATIONSHIP_PROPERTY + SiteType.NAME_ATTRIBUTE_PROPERTY, "foo"); SelectQuery q

Re: joins

2008-05-22 Thread Eric Polino
On Thu, May 22, 2008 at 5:23 PM, Eric Polino <[EMAIL PROTECTED]> wrote: > Given three tables (This is not accurate SQL syntax...but you get the point). > > Reservation { > ... > siteId int foreign key with Site, > ... > } > > Site { > ... > siteId int primary key, > typeId int foreign key wi

joins

2008-05-22 Thread Eric Polino
Given three tables (This is not accurate SQL syntax...but you get the point). Reservation { ... siteId int foreign key with Site, ... } Site { ... siteId int primary key, typeId int foreign key with SiteType, ... } SiteType { ... siteTypeId int primary key, name varchar(32),

Re: Postgresql

2008-05-22 Thread Eric Polino
Thanks for the help. I managed to get it working. I figured out that the init scripts weren't portable from derby to postgres. On Tue, May 6, 2008 at 2:43 PM, Tore Halset <[EMAIL PROTECTED]> wrote: > > On 6. mai. 2008, at 17.43, Eric Polino wrote: > >> We were using derby and have decided to swi