cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgeny Ryabitskiy (JIRA)" <>
Subject [jira] Commented: (CAY-1287) SQLTemplate for not-mapping (DataRow) queries
Date Fri, 02 Oct 2009 06:23:23 GMT


Evgeny Ryabitskiy commented on CAY-1287:

So... why I set it bug and not a new feature....
If you look at Javadoc of SQLTemplate constructor, I can see:

    public SQLTemplate(Class rootClass, String defaultTemplate) {

So lets look at setRoot(rootClass) method:

     * Sets the root of the query
     * @param value The new root
     * @throws IllegalArgumentException if value is not a String, ObjEntity, DbEntity,
     *             Procedure, DataMap, Class or null. < --- look here!
    public void setRoot(Object value) {...... }

But (!!!) if I pass null it throws exception! Looks like it was expected before to work without
mapping for queries....
but implementation not follows it.... 

> SQLTemplate for not-mapping (DataRow) queries
> ---------------------------------------------
>                 Key: CAY-1287
>                 URL:
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>    Affects Versions: 2.0 branch
>            Reporter: Evgeny Ryabitskiy
>             Fix For: 3.0
> I wish to use nice SQLTemplate scripting engine for my simple not-mapping (DataRow) runtime-formed
> But now I should pass a DataObject to SQLTemplate constructor.
> The question is: "For what?"
> To do mapping???
> If my query is like: "SELECT max(id) as MAX_ID from Table1" it has no sense!
> I want to add constructor like: SQLTemplate(String defaultTemplate, Map parameter)
> and teach DataContext to perform such queries well.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message