Re: How to query for LOWER(Column) = 'value'

2010-06-12 Thread Mike Christensen
For the sake of the question, let's just assume my DB is case-sensitive. FYI, I'm using Postgres 8.3.4 which is always case-sensitive (as far as I know).. Mike On Sat, Jun 12, 2010 at 7:14 PM, Patrick Steele patrick.ste...@gmail.com wrote: It depends on the server.  Well, in MS SQL Server 6

Re: How to query for LOWER(Column) = 'value'

2010-06-12 Thread Gauthier Segay
Hi, I don't have an answer for criteria API, but I'm pretty sure hql query would allow you to use any vendor specific function (lower being supported by most of the sql databases) from User u where u.Alias = lower(:alias) last sample on this post describe this:

Querying items in a HasAndBelongToMany relationship

2010-06-12 Thread ubahn
Hi all, I have the following model: Each Product is linked with a ProductBrand Each Product has a HasAndBelongsToMany relationship with ProductCategory and what I`m trying to retrieve is a list of product categories for a given product brand if there are products linked with that brand Can

Re: Querying items in a HasAndBelongToMany relationship

2010-06-12 Thread Mark Borg
OK Guys, solved using a native SQL query SELECT * FROM prod_productcategory pc JOIN prod_productcategories pcs ON pc.id = pcs.productCategoryId JOIN prod_product p ON pcs.productId = p.id AND p.productBrandId = :productBrandId; On Sun, Jun 13, 2010 at 5:57 AM, ubahn markmb...@gmail.com wrote:

Re: Querying items in a HasAndBelongToMany relationship

2010-06-12 Thread Markus Zywitza
Why don't you use HQL for that, it is dead simple: select p.Category from Product p where p.Brand = ? -Markus Am 13. Juni 2010 06:43:28 UTC+2 schrieb Mark Borg markmb...@gmail.com: OK Guys, solved using a native SQL query SELECT * FROM prod_productcategory pc JOIN prod_productcategories