openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Linskey <plins...@gmail.com>
Subject Re: Question about JPQLExpressionBuilder.getTypeLiteral()
Date Sat, 13 Feb 2010 05:38:16 GMT
Digging into this further, it looks like the getVariable() call is  
relatively unused. Maybe it's just a validation check? If so, what's  
it validating? Do we support path traversals etc. in type comparisons,  
or just comparisons to parameters and literals?

Thanks,

-Patrick

On Feb 12, 2010, at 5:12 PM, Patrick Linskey wrote:

> Hi,
>
> I'm working on adding support for queries against a non-relational  
> store, and I've run into an issue with the new JPA2 type literal  
> stuff.
>
> I'm compiling a query such as the following:
>
> 	select s from Skier s where type(s) = Skier
>
> My target database doesn't support joins, so in my ExpressionFactory  
> implementation, I throw exceptions whenever join-ish things are done.
>
> I'm getting into trouble because  
> JPQLExpressionBuilder.getTypeLiteral() calls getVariable(), which  
> ends up calling ExpressionFactory.newUnboundVariable() eventually.  
> Which blows up.
>
> Now, I could change my implementation to not throw in  
> newUnboundVariable(), but I feel like a type literal isn't a  
> variable. Was there some larger bit of rationale behind making  
> getTypeLiteral() return an unbound variable, or should I feel free  
> to dig into changing it to return a more suitable type?
>
> (Incidentally, I've got things working with type parameters (i.e.,  
> 'where type(s) = :type'), so the pathways seem to be great aside  
> from this variable discrepancy.)
>
> Thanks,
>
> -Patrick
>
> -- 
> Patrick Linskey
> 202 669 5907
>

-- 
Patrick Linskey
202 669 5907


Mime
View raw message