fanyun wrote:
>
> The line: addSelectColumns ( criteria ); will bring all the
> columns into select clause. This cause the problem.
> I think it should be
> if(criteria.getSelectColumns().size() == 0)
> addSelectColumns ( criteria );
>
I will add this back in with my changes (see below.)
> ***********Problem 2: the return vector**********************
> the line: results.add (row2Object (row,1,Class.forName
> (className)));
> And the row2Object function is just for a select (*) from abc clause. Other
> sql clause can not use that function.
>
> For this problem I think there should be 2 solution:
> 1. add another doRawSelect() function which will only return the vector
> returned from BasePeer.doSelect().
> User should normalize the result by themselvs. This solution brings flexible
> for users.
>
I have been refactoring the Peers in order to better support subclassing
of OM objects. I have added the method you are requesting. I was
declaring it private, but I should probably go ahead and allow access to
it, it might be useful in reporting templates and other circumstances I
have not thought of.
> 2. the user do not use AbcPeer directly. They first write a class inherated
> from AbcPeer. And override the row2Object funtion to something like:
> if(cls.getName().equals("xxxxx")
> .......
> if(cls.getName().equals("yyyyy")
> .......
> This solution do not need to touch turbine code. But not convenient for
> uses.
>
It is difficult when working with static methods and inheritance. If
AbcdPeer extends AbcPeer and AbcdPeer overrides static method foo(),
AbcdPeer abcd = new AbcdPeer();
AbcPeer abc = (AbcPeer)abcd
abc.foo() will use AbcPeer's version of the method. So you can end up
having to override a lot of methods to achieve your goal and altering
other classes to make sure they are using AbcdPeer not AbcPeer.
John McNally
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]