You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Carfield Yim <ca...@gmail.com> on 2007/01/06 07:15:26 UTC

Can ibatis work with java object with constructor have parameters?

I like to pass something to the object while initalization, can I
specific about that?

Re: Can ibatis work with java object with constructor have parameters?

Posted by Larry Meadors <lm...@apache.org>.
Bah, gmail messed up my code...let's try again...

===

    Reader reader;
    SqlMapClientImpl smc;
    SelectStatement statement;
    String sql;

    // this is just plumbing:
    reader = Resources.getResourceAsReader("com/mwt/config/sqlmap.xml");
    smc = (SqlMapClientImpl) SqlMapClientBuilder.buildSqlMapClient(reader);

    // At this point, you can get a statement and get freaky with it
    // ...all unsupported of course, and if a later release breaks it, you
    // have been warned. :-)
    statement = (SelectStatement)
        smc.getDelegate().getMappedStatement("Customers.fetch");

    // replace the 2nd parameter below with YOUR parameter object, a
    // bean or map or whatever.
    sql = statement.getSql().getSql(null, null);

    // ALSO, who says this has to be SQL? it could be HQL, or an LDAP query, or
    // whatever other crazy stuff you want to try. This is the result
    // in any case:
    System.out.println(sql);

===

Larry

Re: Can ibatis work with java object with constructor have parameters?

Posted by Larry Meadors <lm...@apache.org>.
Hey Paul,

If all you want is the SQL, you can get that with a tiny bit of hacking:

===

    Reader reader;
    SqlMapClientImpl smc;
    SelectStatement statement;
    String sql;

    // this is just plumbing:
    reader = Resources.getResourceAsReader("com/mwt/config/sqlmap.xml");
    smc = (SqlMapClientImpl) SqlMapClientBuilder.buildSqlMapClient(reader);

    // At this point, you can get a statement and get freaky with it
    // ...all unsupported of course, and if a later release breaks it, you
    // have been warned. :-)
    statement = (SelectStatement)
smc.getDelegate().getMappedStatement("Customers.fetch");

    // replace the 2nd parameter below with YOUR parameter object, a
bean or map or whatever.
    sql = statement.getSql().getSql(null, null);

    // ALSO, who says this has to be SQL? it could be HQL, or an LDAP query, or
    // whatever other crazy stuff you want to try. This is the result
in any case:
    System.out.println(sql);

===

Larry


On 1/8/07, Paul Benedict <pb...@apache.org> wrote:
> Brandon,
>
> Sometimes it's good to construct the object directly with access to the
> ResultSet, but using IBATIS to dynamically write the SQL. There's a
> ticket open for this functionality:
>
> http://issues.apache.org/jira/browse/IBATIS-226
>
> My driver is because I cache at the object instance level, and return
> the same instance for the same primary key. This is a little deeper than
> ibatis' caching which is at the statement level -- but with multiple
> statements potentially returning the same object (in terms of object
> identity), this is where having access to the ResultSet is necessary. If
> I can shortcut the creation of the object, I will.
>
> Paul
>
> Brandon Goodin wrote:
> > I'm not completely sure what you are asking. But, if you are asking if
> > you can get the ResultSet itself that would be a no. iBATIS is JDBC
> > wrapper. If you find that you need more direct access to JDBC then you
> > should use JDBC directly.
> >
> > Brandon
> >
> > On 1/7/07, *Carfield Yim* <carfield@gmail.com
> > <ma...@gmail.com>> wrote:
> >
> >     Can I get the reference of resultset when the object is initalizating?
> >
> >     On 1/8/07, Brandon Goodin <brandon.goodin@gmail.com
> >     <ma...@gmail.com>> wrote:
> >      > You can find the javadoc here:
> >      >
> >      >
> >     http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> >     <http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html>
> >      >
> >      > I was assuming you were wanting to map result values to a
> >     constructor. If
> >      > you are trying to map results to a constructor, it would seem a
> >     tedious
> >      > effort to use the ResultObjectFactory for this.
> >      >
> >      > I know it is lame that we don't have this functionality. But, we've
> >      > discussed adding the constructor mapping functionality and have
> >     decided it
> >      > is best to delay adding it until iB3 (no eta).
> >      >
> >      > Brandon
> >      >
> >      >
> >      > On 1/7/07, Carfield Yim <carfield@gmail.com
> >     <ma...@gmail.com>> wrote:
> >      > > I just check for the document and I cannot see those APIs ,
> >      > > http://ibatis.apache.org/docs/java/user/ , am I looking
> >      > for wrong
> >      > > thing?
> >      > >
> >      > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com
> >     <ma...@trisyngroup.com>> wrote:
> >      > > > Have you considered using an implementation of
> >     ResultObjectFactory?  It
> >      > can be configured within iBatis or injected into the
> >     SqlMapExecutorDelegate.
> >      >  Either ways you will have control over the creation and subsequent
> >      > initialization of objects.
> >      > > >
> >      > > > ________________________________
> >      > > >
> >      > > > From: Peng Wang [mailto: wpcfan@gmail.com
> >     <ma...@gmail.com>]
> >      > > > Sent: Sun 1/7/2007 9:26 PM
> >      > > > To: user-java@ibatis.apache.org
> >     <ma...@ibatis.apache.org>
> >      > > > Subject: Re: Can ibatis work with java object with
> >     constructor have
> >      > parameters?
> >      > > >
> >      > > >
> >      > > > You can do this using Spring. I think iBatis does not have to
> >     support
> >      > this.
> >      > > >
> >      > > >
> >      > > > On 1/8/07, Carfield Yim < carfield@gmail.com
> >     <ma...@gmail.com> > wrote:
> >      > > >
> >      > > >         To bad to hear that, is it planned to be implemented?
> >      > > >
> >      > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com
> >     <ma...@gmail.com>> wrote:
> >      > > >         > This is not currently implemented.
> >      > > >         >
> >      > > >         > Brandon
> >      > > >         >
> >      > > >         >
> >      > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> >     <ma...@gmail.com>
> >      > <mailto: carfield@gmail.com <ma...@gmail.com>> > wrote:
> >      > > >         > > I like to pass something to the object while
> >     initalization,
> >      > can I
> >      > > >         > > specific about that?
> >      > > >         > >
> >      > > >         >
> >      > > >         >
> >      > > >
> >      > > >
> >      > > >
> >      > > >
> >      > > >
> >      > >
> >      >
> >      >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Tom Duffey <td...@utilivisor.com>.
On Jan 9, 2007, at 12:56 AM, Paul Benedict wrote:

> My driver is because I cache at the object instance level, and  
> return the same instance for the same primary key. This is a little  
> deeper than ibatis' caching which is at the statement level -- but  
> with multiple statements potentially returning the same object (in  
> terms of object identity), this is where having access to the  
> ResultSet is necessary. If I can shortcut the creation of the  
> object, I will.

Jumping in a little late here but I do exactly this, and I use iBATIS  
*and* I don't require any new iBATIS features.  It's pretty simple:

- Turn off iBATIS caching
- Build a Factory layer that sites right about your iBATIS layer
- Use something like ehcache, oscache, etc. in your factories along  
with some simple methods to ensure object identity

Tom

> Brandon Goodin wrote:
>> I'm not completely sure what you are asking. But, if you are  
>> asking if you can get the ResultSet itself that would be a no.  
>> iBATIS is JDBC wrapper. If you find that you need more direct  
>> access to JDBC then you should use JDBC directly.
>> Brandon
>> On 1/7/07, *Carfield Yim* <carfield@gmail.com  
>> <ma...@gmail.com>> wrote:
>>     Can I get the reference of resultset when the object is  
>> initalizating?
>>     On 1/8/07, Brandon Goodin <brandon.goodin@gmail.com
>>     <ma...@gmail.com>> wrote:
>>      > You can find the javadoc here:
>>      >
>>      >
>>     http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/ 
>> engine/mapping/result/ResultObjectFactory.html
>>     <http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/ 
>> engine/mapping/result/ResultObjectFactory.html>
>>      >
>>      > I was assuming you were wanting to map result values to a
>>     constructor. If
>>      > you are trying to map results to a constructor, it would  
>> seem a
>>     tedious
>>      > effort to use the ResultObjectFactory for this.
>>      >
>>      > I know it is lame that we don't have this functionality.  
>> But, we've
>>      > discussed adding the constructor mapping functionality and  
>> have
>>     decided it
>>      > is best to delay adding it until iB3 (no eta).
>>      >
>>      > Brandon
>>      >
>>      >
>>      > On 1/7/07, Carfield Yim <carfield@gmail.com
>>     <ma...@gmail.com>> wrote:
>>      > > I just check for the document and I cannot see those APIs ,
>>      > > http://ibatis.apache.org/docs/java/user/ , am I looking
>>      > for wrong
>>      > > thing?
>>      > >
>>      > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com
>>     <ma...@trisyngroup.com>> wrote:
>>      > > > Have you considered using an implementation of
>>     ResultObjectFactory?  It
>>      > can be configured within iBatis or injected into the
>>     SqlMapExecutorDelegate.
>>      >  Either ways you will have control over the creation and  
>> subsequent
>>      > initialization of objects.
>>      > > >
>>      > > > ________________________________
>>      > > >
>>      > > > From: Peng Wang [mailto: wpcfan@gmail.com
>>     <ma...@gmail.com>]
>>      > > > Sent: Sun 1/7/2007 9:26 PM
>>      > > > To: user-java@ibatis.apache.org
>>     <ma...@ibatis.apache.org>
>>      > > > Subject: Re: Can ibatis work with java object with
>>     constructor have
>>      > parameters?
>>      > > >
>>      > > >
>>      > > > You can do this using Spring. I think iBatis does not  
>> have to
>>     support
>>      > this.
>>      > > >
>>      > > >
>>      > > > On 1/8/07, Carfield Yim < carfield@gmail.com
>>     <ma...@gmail.com> > wrote:
>>      > > >
>>      > > >         To bad to hear that, is it planned to be  
>> implemented?
>>      > > >
>>      > > >         On 1/8/07, Brandon Goodin <  
>> brandon.goodin@gmail.com
>>     <ma...@gmail.com>> wrote:
>>      > > >         > This is not currently implemented.
>>      > > >         >
>>      > > >         > Brandon
>>      > > >         >
>>      > > >         >
>>      > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
>>     <ma...@gmail.com>
>>      > <mailto: carfield@gmail.com <ma...@gmail.com>> >  
>> wrote:
>>      > > >         > > I like to pass something to the object while
>>     initalization,
>>      > can I
>>      > > >         > > specific about that?
>>      > > >         > >
>>      > > >         >
>>      > > >         >
>>      > > >
>>      > > >
>>      > > >
>>      > > >
>>      > > >
>>      > >
>>      >
>>      >


Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
> * Add a @key attribute to a resultMap. This would flag one or multiple
> properties as being a primary key, and then ibatis could then, if a
> cache is present, check if an object already exists.
>
> <resultMap id="roleMap" cacheModel="roleObjectCache">
> ...
> </resultMap>
>
@key is nice and key is probably what I only need also.

Re: Can ibatis work with java object with constructor have parameters?

Posted by Paul Benedict <pb...@apache.org>.
Brandon,

I am happy with your response. Yes, I am trying to address a current 
failure in extensibility. I could do something with the RowHandler, 
except it's the wrong point in the lifecycle of the data mapper. A 
RowHandler gives you back an object -- but this is not ideal since I 
need to first determine if I have the object already. So in theory I am 
wasting memory and time to create objects I most likely will be tossing 
away.

You could add to IBATIS this way:

* Allow me to attach a cache at the resultMap level.

* Add a @key attribute to a resultMap. This would flag one or multiple 
properties as being a primary key, and then ibatis could then, if a 
cache is present, check if an object already exists.

<resultMap id="roleMap" cacheModel="roleObjectCache">
...
</resultMap>

* Add some other feature to allow flushing of a single object from the 
object cache.

And Tom Duffey writes:

 >> Jumping in a little late here but I do exactly this, and I use 
iBATIS *and*
 >> I don't require any new iBATIS features.  It's pretty simple:
 >> - Turn off iBATIS caching
 >> - Build a Factory layer that sites right about your iBATIS layer
 >> - Use something like ehcache, oscache, etc. in your factories along 
with
 >> some simple methods to ensure object identity

I already do this :-) I front my DAOs with a layer and use OSCache. 
However, this can get very tedious and tough to manage as the # of my 
DAOs grow. If this kind of caching at the object level can be built 
straight into ibatis, life would be easier.

Paul


Re: Can ibatis work with java object with constructor have parameters?

Posted by Brandon Goodin <br...@gmail.com>.
I think there are better ways to address these sorts of issues and remain
true to what iBATIS is about. What you are pointing out would be more tied
to a potential failure in iBATIS extensibility than about getting access to
a raw ResultSet. Also, the caching sounds like something you can implement
with a RowHandler.

Brandon

On 1/9/07, Paul Benedict <pb...@apache.org> wrote:
>
> Brandon,
>
> Sometimes it's good to construct the object directly with access to the
> ResultSet, but using IBATIS to dynamically write the SQL. There's a
> ticket open for this functionality:
>
> http://issues.apache.org/jira/browse/IBATIS-226
>
> My driver is because I cache at the object instance level, and return
> the same instance for the same primary key. This is a little deeper than
> ibatis' caching which is at the statement level -- but with multiple
> statements potentially returning the same object (in terms of object
> identity), this is where having access to the ResultSet is necessary. If
> I can shortcut the creation of the object, I will.
>
> Paul
>
> Brandon Goodin wrote:
> > I'm not completely sure what you are asking. But, if you are asking if
> > you can get the ResultSet itself that would be a no. iBATIS is JDBC
> > wrapper. If you find that you need more direct access to JDBC then you
> > should use JDBC directly.
> >
> > Brandon
> >
> > On 1/7/07, *Carfield Yim* <carfield@gmail.com
> > <ma...@gmail.com>> wrote:
> >
> >     Can I get the reference of resultset when the object is
> initalizating?
> >
> >     On 1/8/07, Brandon Goodin <brandon.goodin@gmail.com
> >     <ma...@gmail.com>> wrote:
> >      > You can find the javadoc here:
> >      >
> >      >
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> >     <
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> >
> >      >
> >      > I was assuming you were wanting to map result values to a
> >     constructor. If
> >      > you are trying to map results to a constructor, it would seem a
> >     tedious
> >      > effort to use the ResultObjectFactory for this.
> >      >
> >      > I know it is lame that we don't have this functionality. But,
> we've
> >      > discussed adding the constructor mapping functionality and have
> >     decided it
> >      > is best to delay adding it until iB3 (no eta).
> >      >
> >      > Brandon
> >      >
> >      >
> >      > On 1/7/07, Carfield Yim <carfield@gmail.com
> >     <ma...@gmail.com>> wrote:
> >      > > I just check for the document and I cannot see those APIs ,
> >      > > http://ibatis.apache.org/docs/java/user/ , am I looking
> >      > for wrong
> >      > > thing?
> >      > >
> >      > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com
> >     <ma...@trisyngroup.com>> wrote:
> >      > > > Have you considered using an implementation of
> >     ResultObjectFactory?  It
> >      > can be configured within iBatis or injected into the
> >     SqlMapExecutorDelegate.
> >      >  Either ways you will have control over the creation and
> subsequent
> >      > initialization of objects.
> >      > > >
> >      > > > ________________________________
> >      > > >
> >      > > > From: Peng Wang [mailto: wpcfan@gmail.com
> >     <ma...@gmail.com>]
> >      > > > Sent: Sun 1/7/2007 9:26 PM
> >      > > > To: user-java@ibatis.apache.org
> >     <ma...@ibatis.apache.org>
> >      > > > Subject: Re: Can ibatis work with java object with
> >     constructor have
> >      > parameters?
> >      > > >
> >      > > >
> >      > > > You can do this using Spring. I think iBatis does not have to
> >     support
> >      > this.
> >      > > >
> >      > > >
> >      > > > On 1/8/07, Carfield Yim < carfield@gmail.com
> >     <ma...@gmail.com> > wrote:
> >      > > >
> >      > > >         To bad to hear that, is it planned to be implemented?
> >      > > >
> >      > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com
> >     <ma...@gmail.com>> wrote:
> >      > > >         > This is not currently implemented.
> >      > > >         >
> >      > > >         > Brandon
> >      > > >         >
> >      > > >         >
> >      > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> >     <ma...@gmail.com>
> >      > <mailto: carfield@gmail.com <ma...@gmail.com>> > wrote:
> >      > > >         > > I like to pass something to the object while
> >     initalization,
> >      > can I
> >      > > >         > > specific about that?
> >      > > >         > >
> >      > > >         >
> >      > > >         >
> >      > > >
> >      > > >
> >      > > >
> >      > > >
> >      > > >
> >      > >
> >      >
> >      >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Paul Benedict <pb...@apache.org>.
Brandon,

Sometimes it's good to construct the object directly with access to the 
ResultSet, but using IBATIS to dynamically write the SQL. There's a 
ticket open for this functionality:

http://issues.apache.org/jira/browse/IBATIS-226

My driver is because I cache at the object instance level, and return 
the same instance for the same primary key. This is a little deeper than 
ibatis' caching which is at the statement level -- but with multiple 
statements potentially returning the same object (in terms of object 
identity), this is where having access to the ResultSet is necessary. If 
I can shortcut the creation of the object, I will.

Paul

Brandon Goodin wrote:
> I'm not completely sure what you are asking. But, if you are asking if 
> you can get the ResultSet itself that would be a no. iBATIS is JDBC 
> wrapper. If you find that you need more direct access to JDBC then you 
> should use JDBC directly.
> 
> Brandon
> 
> On 1/7/07, *Carfield Yim* <carfield@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>     Can I get the reference of resultset when the object is initalizating?
> 
>     On 1/8/07, Brandon Goodin <brandon.goodin@gmail.com
>     <ma...@gmail.com>> wrote:
>      > You can find the javadoc here:
>      >
>      >
>     http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
>     <http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html>
>      >
>      > I was assuming you were wanting to map result values to a
>     constructor. If
>      > you are trying to map results to a constructor, it would seem a
>     tedious
>      > effort to use the ResultObjectFactory for this.
>      >
>      > I know it is lame that we don't have this functionality. But, we've
>      > discussed adding the constructor mapping functionality and have
>     decided it
>      > is best to delay adding it until iB3 (no eta).
>      >
>      > Brandon
>      >
>      >
>      > On 1/7/07, Carfield Yim <carfield@gmail.com
>     <ma...@gmail.com>> wrote:
>      > > I just check for the document and I cannot see those APIs ,
>      > > http://ibatis.apache.org/docs/java/user/ , am I looking
>      > for wrong
>      > > thing?
>      > >
>      > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com
>     <ma...@trisyngroup.com>> wrote:
>      > > > Have you considered using an implementation of
>     ResultObjectFactory?  It
>      > can be configured within iBatis or injected into the
>     SqlMapExecutorDelegate.
>      >  Either ways you will have control over the creation and subsequent
>      > initialization of objects.
>      > > >
>      > > > ________________________________
>      > > >
>      > > > From: Peng Wang [mailto: wpcfan@gmail.com
>     <ma...@gmail.com>]
>      > > > Sent: Sun 1/7/2007 9:26 PM
>      > > > To: user-java@ibatis.apache.org
>     <ma...@ibatis.apache.org>
>      > > > Subject: Re: Can ibatis work with java object with
>     constructor have
>      > parameters?
>      > > >
>      > > >
>      > > > You can do this using Spring. I think iBatis does not have to
>     support
>      > this.
>      > > >
>      > > >
>      > > > On 1/8/07, Carfield Yim < carfield@gmail.com
>     <ma...@gmail.com> > wrote:
>      > > >
>      > > >         To bad to hear that, is it planned to be implemented?
>      > > >
>      > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com
>     <ma...@gmail.com>> wrote:
>      > > >         > This is not currently implemented.
>      > > >         >
>      > > >         > Brandon
>      > > >         >
>      > > >         >
>      > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
>     <ma...@gmail.com>
>      > <mailto: carfield@gmail.com <ma...@gmail.com>> > wrote:
>      > > >         > > I like to pass something to the object while
>     initalization,
>      > can I
>      > > >         > > specific about that?
>      > > >         > >
>      > > >         >
>      > > >         >
>      > > >
>      > > >
>      > > >
>      > > >
>      > > >
>      > >
>      >
>      >
> 
> 

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
Will you have any recommendation for my use case?

On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> No you cannot get a ResultSet. iBATIS will not at anytime from anywhere
> provide you a reference to the ResultSet.
>
> Brandon
>
>
> On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > Just really read
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > , However can I get the resultset from the RowHandler?
> >
> > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > Sounds like you can use a RowHandler for this.
> > >
> > >
> > > Brandon
> > >
> > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > Actually I get I cannot do... but anyway, just ask.
> > > >
> > > > For method
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
> > > > java.lang.Class)
> > > >
> > > > instead of having
> > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > Class[]{String.class});
> > > >     return con.newInstance(objectStaticAvailable);
> > > > }
> > > >
> > > > Can I init the object using resultset result, like
> > > >
> > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> clazz) {
> > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > Class[]{String.class});
> > > >     return con.newInstance(rs.getString("id"));
> > > > }
> > > >
> > > > So that I can use the ID of the record to check for permission when
> > > > initalization. If the user don't have permission to load that record,
> > > > the system will throw an exception and we will show an generic
> > > > permission deny page.
> > > >
> > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > I'm not completely sure what you are asking. But, if you are asking
> if
> > > you
> > > > > can get the ResultSet itself that would be a no. iBATIS is JDBC
> wrapper.
> > > If
> > > > > you find that you need more direct access to JDBC then you should
> use
> > > JDBC
> > > > > directly.
> > > > >
> > > > >
> > > > > Brandon
> > > > >
> > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > Can I get the reference of resultset when the object is
> initalizating?
> > > > > >
> > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > You can find the javadoc here:
> > > > > > >
> > > > > > >
> > > > >
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > > >
> > > > > > > I was assuming you were wanting to map result values to a
> > > constructor.
> > > > > If
> > > > > > > you are trying to map results to a constructor, it would seem a
> > > tedious
> > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > >
> > > > > > > I know it is lame that we don't have this functionality. But,
> we've
> > > > > > > discussed adding the constructor mapping functionality and have
> > > decided
> > > > > it
> > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > >
> > > > > > > Brandon
> > > > > > >
> > > > > > >
> > > > > > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > > > > I just check for the document and I cannot see those APIs ,
> > > > > > > > http://ibatis.apache.org/docs/java/user/ , am
> I
> > > > > looking
> > > > > > > for wrong
> > > > > > > > thing?
> > > > > > > >
> > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> wrote:
> > > > > > > > > Have you considered using an implementation of
> > > ResultObjectFactory?
> > > > > It
> > > > > > > can be configured within iBatis or injected into the
> > > > > SqlMapExecutorDelegate.
> > > > > > >  Either ways you will have control over the creation and
> subsequent
> > > > > > > initialization of objects.
> > > > > > > > >
> > > > > > > > > ________________________________
> > > > > > > > >
> > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > Subject: Re: Can ibatis work with java object with
> constructor
> > > have
> > > > > > > parameters?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > You can do this using Spring. I think iBatis does not have
> to
> > > > > support
> > > > > > > this.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > >
> > > > > > > > >         To bad to hear that, is it planned to be
> implemented?
> > > > > > > > >
> > > > > > > > >         On 1/8/07, Brandon Goodin <
> brandon.goodin@gmail.com>
> > > wrote:
> > > > > > > > >         > This is not currently implemented.
> > > > > > > > >         >
> > > > > > > > >         > Brandon
> > > > > > > > >         >
> > > > > > > > >         >
> > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > >         > > I like to pass something to the object while
> > > > > initalization,
> > > > > > > can I
> > > > > > > > >         > > specific about that?
> > > > > > > > >         > >
> > > > > > > > >         >
> > > > > > > > >         >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
Something like

public Account(String id) {
    if(getSession().getUser().hasPermission(getClass(), id))
        this.id = id;
    else
        throws new PermissionDenyException();
}


On 1/9/07, Larry Meadors <lm...@apache.org> wrote:
> Can you maybeprovide some pseudo-ode for what you are trying to do
> that would require access to a result set?
>
> I am totally not seeing it.
>
> Larry
>
>
> On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > That is kind of surprise me, I thought this is a common use case to
> > implement role permission. However look like this is not the case.
> >
> > In fact I just do it this way in my last application as we write DAO
> > ourselves without any tools. May be you can share how ibatis user
> > commonly do for role permission?
> >
> > On 1/9/07, Clinton Begin <cl...@gmail.com> wrote:
> > >
> > > ACK!!! Sorry, my bad.  It wasn't RowHandler.  It was the custom
> > > TypeHandlerCallback.  ResultGetter now exposes the ResultSet.
> > >
> > > Sorry for the confusion and my unclear brain before my Starbucks Grande
> > > Half-Sweet Vanilla Americano with room.
> > >
> > > Cheers,
> > > Clinton
> > >
> > > On 1/8/07, Larry Meadors <lm...@apache.org> wrote:
> > > > Hmm, RowHandler is clear of java.sql references - as it should be.
> > > >
> > > > There are some ResultSet references passed around in the type handler
> > > > extension points..
> > > >
> > > > Larry
> > > >
> > > >
> > > > On 1/8/07, Clinton Begin < clinton.begin@gmail.com> wrote:
> > > > > Except for that new method Larry added to the RowHandler APIs...you can
> > > now
> > > > > get the original ResultSet while the rows are being returned from within
> > > a
> > > > > RowHandler.
> > > > >
> > > > > But other than that very isolated case, Brandon is right, you can't just
> > > > > arbitrarily get the ResultSet and do with it as you please.
> > > > >
> > > > > Cheers,
> > > > > Clinton
> > > > >
> > > > >
> > > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > > No you cannot get a ResultSet. iBATIS will not at anytime from
> > > anywhere
> > > > > provide you a reference to the ResultSet.
> > > > > >
> > > > > > Brandon
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > > > Just really read
> > > > > > >
> > > > >
> > > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > > > > > > , However can I get the resultset from the RowHandler?
> > > > > > >
> > > > > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > > > > Sounds like you can use a RowHandler for this.
> > > > > > > >
> > > > > > > >
> > > > > > > > Brandon
> > > > > > > >
> > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > Actually I get I cannot do... but anyway, just ask.
> > > > > > > > >
> > > > > > > > > For method
> > > > > > > >
> > > > >
> > > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
> > > > > > > > > java.lang.Class)
> > > > > > > > >
> > > > > > > > > instead of having
> > > > > > > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > > > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > > > > Class[]{String.class});
> > > > > > > > >     return con.newInstance(objectStaticAvailable);
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > Can I init the object using resultset result, like
> > > > > > > > >
> > > > > > > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> > > > > clazz) {
> > > > > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > > > > Class[]{ String.class});
> > > > > > > > >     return con.newInstance(rs.getString("id"));
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > So that I can use the ID of the record to check for permission
> > > when
> > > > > > > > > initalization. If the user don't have permission to load that
> > > > > record,
> > > > > > > > > the system will throw an exception and we will show an generic
> > > > > > > > > permission deny page.
> > > > > > > > >
> > > > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > > > > > > I'm not completely sure what you are asking. But, if you are
> > > > > asking if
> > > > > > > > you
> > > > > > > > > > can get the ResultSet itself that would be a no. iBATIS is
> > > JDBC
> > > > > wrapper.
> > > > > > > > If
> > > > > > > > > > you find that you need more direct access to JDBC then you
> > > should
> > > > > use
> > > > > > > > JDBC
> > > > > > > > > > directly.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Brandon
> > > > > > > > > >
> > > > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > > > Can I get the reference of resultset when the object is
> > > > > initalizating?
> > > > > > > > > > >
> > > > > > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > > > > > > You can find the javadoc here:
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > >
> > > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > > > > > > > >
> > > > > > > > > > > > I was assuming you were wanting to map result values to a
> > > > > > > > constructor.
> > > > > > > > > > If
> > > > > > > > > > > > you are trying to map results to a constructor, it would
> > > seem
> > > > > a
> > > > > > > > tedious
> > > > > > > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > > > > > > >
> > > > > > > > > > > > I know it is lame that we don't have this functionality.
> > > But,
> > > > > we've
> > > > > > > > > > > > discussed adding the constructor mapping functionality and
> > > > > have
> > > > > > > > decided
> > > > > > > > > > it
> > > > > > > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > > > > > > >
> > > > > > > > > > > > Brandon
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > > > > > I just check for the document and I cannot see those
> > > APIs ,
> > > > > > > > > > > > >
> > > http://ibatis.apache.org/docs/java/user/ ,
> > > > > am I
> > > > > > > > > > looking
> > > > > > > > > > > > for wrong
> > > > > > > > > > > > > thing?
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> > > > > wrote:
> > > > > > > > > > > > > > Have you considered using an implementation of
> > > > > > > > ResultObjectFactory?
> > > > > > > > > > It
> > > > > > > > > > > > can be configured within iBatis or injected into the
> > > > > > > > > > SqlMapExecutorDelegate.
> > > > > > > > > > > >  Either ways you will have control over the creation and
> > > > > subsequent
> > > > > > > > > > > > initialization of objects.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > ________________________________
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > > > > > > Subject: Re: Can ibatis work with java object with
> > > > > constructor
> > > > > > > > have
> > > > > > > > > > > > parameters?
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > You can do this using Spring. I think iBatis does not
> > > have
> > > > > to
> > > > > > > > > > support
> > > > > > > > > > > > this.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >         To bad to hear that, is it planned to be
> > > > > implemented?
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >         On 1/8/07, Brandon Goodin <
> > > > > brandon.goodin@gmail.com >
> > > > > > > > wrote:
> > > > > > > > > > > > > >         > This is not currently implemented.
> > > > > > > > > > > > > >         >
> > > > > > > > > > > > > >         > Brandon
> > > > > > > > > > > > > >         >
> > > > > > > > > > > > > >         >
> > > > > > > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > > > > > > >         > > I like to pass something to the object
> > > while
> > > > > > > > > > initalization,
> > > > > > > > > > > > can I
> > > > > > > > > > > > > >         > > specific about that?
> > > > > > > > > > > > > >         > >
> > > > > > > > > > > > > >         >
> > > > > > > > > > > > > >         >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Larry Meadors <lm...@apache.org>.
Can you maybeprovide some pseudo-ode for what you are trying to do
that would require access to a result set?

I am totally not seeing it.

Larry


On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> That is kind of surprise me, I thought this is a common use case to
> implement role permission. However look like this is not the case.
>
> In fact I just do it this way in my last application as we write DAO
> ourselves without any tools. May be you can share how ibatis user
> commonly do for role permission?
>
> On 1/9/07, Clinton Begin <cl...@gmail.com> wrote:
> >
> > ACK!!! Sorry, my bad.  It wasn't RowHandler.  It was the custom
> > TypeHandlerCallback.  ResultGetter now exposes the ResultSet.
> >
> > Sorry for the confusion and my unclear brain before my Starbucks Grande
> > Half-Sweet Vanilla Americano with room.
> >
> > Cheers,
> > Clinton
> >
> > On 1/8/07, Larry Meadors <lm...@apache.org> wrote:
> > > Hmm, RowHandler is clear of java.sql references - as it should be.
> > >
> > > There are some ResultSet references passed around in the type handler
> > > extension points..
> > >
> > > Larry
> > >
> > >
> > > On 1/8/07, Clinton Begin < clinton.begin@gmail.com> wrote:
> > > > Except for that new method Larry added to the RowHandler APIs...you can
> > now
> > > > get the original ResultSet while the rows are being returned from within
> > a
> > > > RowHandler.
> > > >
> > > > But other than that very isolated case, Brandon is right, you can't just
> > > > arbitrarily get the ResultSet and do with it as you please.
> > > >
> > > > Cheers,
> > > > Clinton
> > > >
> > > >
> > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > No you cannot get a ResultSet. iBATIS will not at anytime from
> > anywhere
> > > > provide you a reference to the ResultSet.
> > > > >
> > > > > Brandon
> > > > >
> > > > >
> > > > >
> > > > > On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > > Just really read
> > > > > >
> > > >
> > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > > > > > , However can I get the resultset from the RowHandler?
> > > > > >
> > > > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > > > Sounds like you can use a RowHandler for this.
> > > > > > >
> > > > > > >
> > > > > > > Brandon
> > > > > > >
> > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > Actually I get I cannot do... but anyway, just ask.
> > > > > > > >
> > > > > > > > For method
> > > > > > >
> > > >
> > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
> > > > > > > > java.lang.Class)
> > > > > > > >
> > > > > > > > instead of having
> > > > > > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > > > Class[]{String.class});
> > > > > > > >     return con.newInstance(objectStaticAvailable);
> > > > > > > > }
> > > > > > > >
> > > > > > > > Can I init the object using resultset result, like
> > > > > > > >
> > > > > > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> > > > clazz) {
> > > > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > > > Class[]{ String.class});
> > > > > > > >     return con.newInstance(rs.getString("id"));
> > > > > > > > }
> > > > > > > >
> > > > > > > > So that I can use the ID of the record to check for permission
> > when
> > > > > > > > initalization. If the user don't have permission to load that
> > > > record,
> > > > > > > > the system will throw an exception and we will show an generic
> > > > > > > > permission deny page.
> > > > > > > >
> > > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > > > > > I'm not completely sure what you are asking. But, if you are
> > > > asking if
> > > > > > > you
> > > > > > > > > can get the ResultSet itself that would be a no. iBATIS is
> > JDBC
> > > > wrapper.
> > > > > > > If
> > > > > > > > > you find that you need more direct access to JDBC then you
> > should
> > > > use
> > > > > > > JDBC
> > > > > > > > > directly.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Brandon
> > > > > > > > >
> > > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > > Can I get the reference of resultset when the object is
> > > > initalizating?
> > > > > > > > > >
> > > > > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > > > > > You can find the javadoc here:
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > >
> > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > > > > > > >
> > > > > > > > > > > I was assuming you were wanting to map result values to a
> > > > > > > constructor.
> > > > > > > > > If
> > > > > > > > > > > you are trying to map results to a constructor, it would
> > seem
> > > > a
> > > > > > > tedious
> > > > > > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > > > > > >
> > > > > > > > > > > I know it is lame that we don't have this functionality.
> > But,
> > > > we've
> > > > > > > > > > > discussed adding the constructor mapping functionality and
> > > > have
> > > > > > > decided
> > > > > > > > > it
> > > > > > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > > > > > >
> > > > > > > > > > > Brandon
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > > > > I just check for the document and I cannot see those
> > APIs ,
> > > > > > > > > > > >
> > http://ibatis.apache.org/docs/java/user/ ,
> > > > am I
> > > > > > > > > looking
> > > > > > > > > > > for wrong
> > > > > > > > > > > > thing?
> > > > > > > > > > > >
> > > > > > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> > > > wrote:
> > > > > > > > > > > > > Have you considered using an implementation of
> > > > > > > ResultObjectFactory?
> > > > > > > > > It
> > > > > > > > > > > can be configured within iBatis or injected into the
> > > > > > > > > SqlMapExecutorDelegate.
> > > > > > > > > > >  Either ways you will have control over the creation and
> > > > subsequent
> > > > > > > > > > > initialization of objects.
> > > > > > > > > > > > >
> > > > > > > > > > > > > ________________________________
> > > > > > > > > > > > >
> > > > > > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > > > > > Subject: Re: Can ibatis work with java object with
> > > > constructor
> > > > > > > have
> > > > > > > > > > > parameters?
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > You can do this using Spring. I think iBatis does not
> > have
> > > > to
> > > > > > > > > support
> > > > > > > > > > > this.
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > >         To bad to hear that, is it planned to be
> > > > implemented?
> > > > > > > > > > > > >
> > > > > > > > > > > > >         On 1/8/07, Brandon Goodin <
> > > > brandon.goodin@gmail.com >
> > > > > > > wrote:
> > > > > > > > > > > > >         > This is not currently implemented.
> > > > > > > > > > > > >         >
> > > > > > > > > > > > >         > Brandon
> > > > > > > > > > > > >         >
> > > > > > > > > > > > >         >
> > > > > > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > > > > > >         > > I like to pass something to the object
> > while
> > > > > > > > > initalization,
> > > > > > > > > > > can I
> > > > > > > > > > > > >         > > specific about that?
> > > > > > > > > > > > >         > >
> > > > > > > > > > > > >         >
> > > > > > > > > > > > >         >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
That is kind of surprise me, I thought this is a common use case to
implement role permission. However look like this is not the case.

In fact I just do it this way in my last application as we write DAO
ourselves without any tools. May be you can share how ibatis user
commonly do for role permission?

On 1/9/07, Clinton Begin <cl...@gmail.com> wrote:
>
> ACK!!! Sorry, my bad.  It wasn't RowHandler.  It was the custom
> TypeHandlerCallback.  ResultGetter now exposes the ResultSet.
>
> Sorry for the confusion and my unclear brain before my Starbucks Grande
> Half-Sweet Vanilla Americano with room.
>
> Cheers,
> Clinton
>
> On 1/8/07, Larry Meadors <lm...@apache.org> wrote:
> > Hmm, RowHandler is clear of java.sql references - as it should be.
> >
> > There are some ResultSet references passed around in the type handler
> > extension points..
> >
> > Larry
> >
> >
> > On 1/8/07, Clinton Begin < clinton.begin@gmail.com> wrote:
> > > Except for that new method Larry added to the RowHandler APIs...you can
> now
> > > get the original ResultSet while the rows are being returned from within
> a
> > > RowHandler.
> > >
> > > But other than that very isolated case, Brandon is right, you can't just
> > > arbitrarily get the ResultSet and do with it as you please.
> > >
> > > Cheers,
> > > Clinton
> > >
> > >
> > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > No you cannot get a ResultSet. iBATIS will not at anytime from
> anywhere
> > > provide you a reference to the ResultSet.
> > > >
> > > > Brandon
> > > >
> > > >
> > > >
> > > > On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > Just really read
> > > > >
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > > > > , However can I get the resultset from the RowHandler?
> > > > >
> > > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > > Sounds like you can use a RowHandler for this.
> > > > > >
> > > > > >
> > > > > > Brandon
> > > > > >
> > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > Actually I get I cannot do... but anyway, just ask.
> > > > > > >
> > > > > > > For method
> > > > > >
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
> > > > > > > java.lang.Class)
> > > > > > >
> > > > > > > instead of having
> > > > > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > > Class[]{String.class});
> > > > > > >     return con.newInstance(objectStaticAvailable);
> > > > > > > }
> > > > > > >
> > > > > > > Can I init the object using resultset result, like
> > > > > > >
> > > > > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> > > clazz) {
> > > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > > Class[]{ String.class});
> > > > > > >     return con.newInstance(rs.getString("id"));
> > > > > > > }
> > > > > > >
> > > > > > > So that I can use the ID of the record to check for permission
> when
> > > > > > > initalization. If the user don't have permission to load that
> > > record,
> > > > > > > the system will throw an exception and we will show an generic
> > > > > > > permission deny page.
> > > > > > >
> > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > > > > I'm not completely sure what you are asking. But, if you are
> > > asking if
> > > > > > you
> > > > > > > > can get the ResultSet itself that would be a no. iBATIS is
> JDBC
> > > wrapper.
> > > > > > If
> > > > > > > > you find that you need more direct access to JDBC then you
> should
> > > use
> > > > > > JDBC
> > > > > > > > directly.
> > > > > > > >
> > > > > > > >
> > > > > > > > Brandon
> > > > > > > >
> > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > Can I get the reference of resultset when the object is
> > > initalizating?
> > > > > > > > >
> > > > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > > > > You can find the javadoc here:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > >
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > > > > > >
> > > > > > > > > > I was assuming you were wanting to map result values to a
> > > > > > constructor.
> > > > > > > > If
> > > > > > > > > > you are trying to map results to a constructor, it would
> seem
> > > a
> > > > > > tedious
> > > > > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > > > > >
> > > > > > > > > > I know it is lame that we don't have this functionality.
> But,
> > > we've
> > > > > > > > > > discussed adding the constructor mapping functionality and
> > > have
> > > > > > decided
> > > > > > > > it
> > > > > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > > > > >
> > > > > > > > > > Brandon
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > > > I just check for the document and I cannot see those
> APIs ,
> > > > > > > > > > >
> http://ibatis.apache.org/docs/java/user/ ,
> > > am I
> > > > > > > > looking
> > > > > > > > > > for wrong
> > > > > > > > > > > thing?
> > > > > > > > > > >
> > > > > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> > > wrote:
> > > > > > > > > > > > Have you considered using an implementation of
> > > > > > ResultObjectFactory?
> > > > > > > > It
> > > > > > > > > > can be configured within iBatis or injected into the
> > > > > > > > SqlMapExecutorDelegate.
> > > > > > > > > >  Either ways you will have control over the creation and
> > > subsequent
> > > > > > > > > > initialization of objects.
> > > > > > > > > > > >
> > > > > > > > > > > > ________________________________
> > > > > > > > > > > >
> > > > > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > > > > Subject: Re: Can ibatis work with java object with
> > > constructor
> > > > > > have
> > > > > > > > > > parameters?
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > You can do this using Spring. I think iBatis does not
> have
> > > to
> > > > > > > > support
> > > > > > > > > > this.
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > >         To bad to hear that, is it planned to be
> > > implemented?
> > > > > > > > > > > >
> > > > > > > > > > > >         On 1/8/07, Brandon Goodin <
> > > brandon.goodin@gmail.com >
> > > > > > wrote:
> > > > > > > > > > > >         > This is not currently implemented.
> > > > > > > > > > > >         >
> > > > > > > > > > > >         > Brandon
> > > > > > > > > > > >         >
> > > > > > > > > > > >         >
> > > > > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > > > > >         > > I like to pass something to the object
> while
> > > > > > > > initalization,
> > > > > > > > > > can I
> > > > > > > > > > > >         > > specific about that?
> > > > > > > > > > > >         > >
> > > > > > > > > > > >         >
> > > > > > > > > > > >         >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Clinton Begin <cl...@gmail.com>.
ACK!!! Sorry, my bad.  It wasn't RowHandler.  It was the custom
TypeHandlerCallback.  ResultGetter now exposes the ResultSet.

Sorry for the confusion and my unclear brain before my Starbucks Grande
Half-Sweet Vanilla Americano with room.

Cheers,
Clinton

On 1/8/07, Larry Meadors <lm...@apache.org> wrote:
>
> Hmm, RowHandler is clear of java.sql references - as it should be.
>
> There are some ResultSet references passed around in the type handler
> extension points..
>
> Larry
>
>
> On 1/8/07, Clinton Begin <cl...@gmail.com> wrote:
> > Except for that new method Larry added to the RowHandler APIs...you can
> now
> > get the original ResultSet while the rows are being returned from within
> a
> > RowHandler.
> >
> > But other than that very isolated case, Brandon is right, you can't just
> > arbitrarily get the ResultSet and do with it as you please.
> >
> > Cheers,
> > Clinton
> >
> >
> > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > No you cannot get a ResultSet. iBATIS will not at anytime from
> anywhere
> > provide you a reference to the ResultSet.
> > >
> > > Brandon
> > >
> > >
> > >
> > > On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > Just really read
> > > >
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > > > , However can I get the resultset from the RowHandler?
> > > >
> > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > Sounds like you can use a RowHandler for this.
> > > > >
> > > > >
> > > > > Brandon
> > > > >
> > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > Actually I get I cannot do... but anyway, just ask.
> > > > > >
> > > > > > For method
> > > > >
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String
> ,
> > > > > > java.lang.Class)
> > > > > >
> > > > > > instead of having
> > > > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > Class[]{String.class});
> > > > > >     return con.newInstance(objectStaticAvailable);
> > > > > > }
> > > > > >
> > > > > > Can I init the object using resultset result, like
> > > > > >
> > > > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> > clazz) {
> > > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > > Class[]{String.class});
> > > > > >     return con.newInstance(rs.getString("id"));
> > > > > > }
> > > > > >
> > > > > > So that I can use the ID of the record to check for permission
> when
> > > > > > initalization. If the user don't have permission to load that
> > record,
> > > > > > the system will throw an exception and we will show an generic
> > > > > > permission deny page.
> > > > > >
> > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > > > I'm not completely sure what you are asking. But, if you are
> > asking if
> > > > > you
> > > > > > > can get the ResultSet itself that would be a no. iBATIS is
> JDBC
> > wrapper.
> > > > > If
> > > > > > > you find that you need more direct access to JDBC then you
> should
> > use
> > > > > JDBC
> > > > > > > directly.
> > > > > > >
> > > > > > >
> > > > > > > Brandon
> > > > > > >
> > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > Can I get the reference of resultset when the object is
> > initalizating?
> > > > > > > >
> > > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > > > You can find the javadoc here:
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > > > > >
> > > > > > > > > I was assuming you were wanting to map result values to a
> > > > > constructor.
> > > > > > > If
> > > > > > > > > you are trying to map results to a constructor, it would
> seem
> > a
> > > > > tedious
> > > > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > > > >
> > > > > > > > > I know it is lame that we don't have this functionality.
> But,
> > we've
> > > > > > > > > discussed adding the constructor mapping functionality and
> > have
> > > > > decided
> > > > > > > it
> > > > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > > > >
> > > > > > > > > Brandon
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > > I just check for the document and I cannot see those
> APIs ,
> > > > > > > > > > http://ibatis.apache.org/docs/java/user/ ,
> > am I
> > > > > > > looking
> > > > > > > > > for wrong
> > > > > > > > > > thing?
> > > > > > > > > >
> > > > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> > wrote:
> > > > > > > > > > > Have you considered using an implementation of
> > > > > ResultObjectFactory?
> > > > > > > It
> > > > > > > > > can be configured within iBatis or injected into the
> > > > > > > SqlMapExecutorDelegate.
> > > > > > > > >  Either ways you will have control over the creation and
> > subsequent
> > > > > > > > > initialization of objects.
> > > > > > > > > > >
> > > > > > > > > > > ________________________________
> > > > > > > > > > >
> > > > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > > > Subject: Re: Can ibatis work with java object with
> > constructor
> > > > > have
> > > > > > > > > parameters?
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > You can do this using Spring. I think iBatis does not
> have
> > to
> > > > > > > support
> > > > > > > > > this.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > > > >
> > > > > > > > > > >         To bad to hear that, is it planned to be
> > implemented?
> > > > > > > > > > >
> > > > > > > > > > >         On 1/8/07, Brandon Goodin <
> > brandon.goodin@gmail.com>
> > > > > wrote:
> > > > > > > > > > >         > This is not currently implemented.
> > > > > > > > > > >         >
> > > > > > > > > > >         > Brandon
> > > > > > > > > > >         >
> > > > > > > > > > >         >
> > > > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > > > >         > > I like to pass something to the object
> while
> > > > > > > initalization,
> > > > > > > > > can I
> > > > > > > > > > >         > > specific about that?
> > > > > > > > > > >         > >
> > > > > > > > > > >         >
> > > > > > > > > > >         >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
>

Re: ResultSet ... getTimestamp with Calendar

Posted by Larry Meadors <lm...@apache.org>.
Nope, it doesn't.

Larry


On 1/10/07, Cornel Antohi <ca...@kepler-rominfo.com> wrote:
> Hi,
>
> Any answer to this question ... please?
>
> Thank you,
> Cornel
>
> ----- Original Message -----
> From: "Cornel Antohi" <ca...@kepler-rominfo.com>
> To: <us...@ibatis.apache.org>
> Sent: Monday, January 08, 2007 8:26 PM
> Subject: ResultSet ... getTimestamp with Calendar
>
>
> > Hi,
> >
> > I would like to ask you if iBatis offers support for the following JDBC
> > function:
> >
> > http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getTimestamp(int,%20java.util.Calendar)
> >
> > Thank you,
> > Cornel
>
>

Re: ResultSet ... getTimestamp with Calendar

Posted by Cornel Antohi <ca...@kepler-rominfo.com>.
Hi,

Any answer to this question ... please?

Thank you,
Cornel

----- Original Message ----- 
From: "Cornel Antohi" <ca...@kepler-rominfo.com>
To: <us...@ibatis.apache.org>
Sent: Monday, January 08, 2007 8:26 PM
Subject: ResultSet ... getTimestamp with Calendar


> Hi,
>
> I would like to ask you if iBatis offers support for the following JDBC 
> function:
>
> http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getTimestamp(int,%20java.util.Calendar)
>
> Thank you,
> Cornel 


ResultSet ... getTimestamp with Calendar

Posted by Cornel Antohi <ca...@kepler-rominfo.com>.
Hi,

I would like to ask you if iBatis offers support for the following JDBC 
function:

http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getTimestamp(int,%20java.util.Calendar)

Thank you,
Cornel 


Re: Can ibatis work with java object with constructor have parameters?

Posted by Larry Meadors <lm...@apache.org>.
Hmm, RowHandler is clear of java.sql references - as it should be.

There are some ResultSet references passed around in the type handler
extension points..

Larry


On 1/8/07, Clinton Begin <cl...@gmail.com> wrote:
> Except for that new method Larry added to the RowHandler APIs...you can now
> get the original ResultSet while the rows are being returned from within a
> RowHandler.
>
> But other than that very isolated case, Brandon is right, you can't just
> arbitrarily get the ResultSet and do with it as you please.
>
> Cheers,
> Clinton
>
>
> On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > No you cannot get a ResultSet. iBATIS will not at anytime from anywhere
> provide you a reference to the ResultSet.
> >
> > Brandon
> >
> >
> >
> > On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > > Just really read
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > > , However can I get the resultset from the RowHandler?
> > >
> > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > Sounds like you can use a RowHandler for this.
> > > >
> > > >
> > > > Brandon
> > > >
> > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > Actually I get I cannot do... but anyway, just ask.
> > > > >
> > > > > For method
> > > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
> > > > > java.lang.Class)
> > > > >
> > > > > instead of having
> > > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > Class[]{String.class});
> > > > >     return con.newInstance(objectStaticAvailable);
> > > > > }
> > > > >
> > > > > Can I init the object using resultset result, like
> > > > >
> > > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> clazz) {
> > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > Class[]{String.class});
> > > > >     return con.newInstance(rs.getString("id"));
> > > > > }
> > > > >
> > > > > So that I can use the ID of the record to check for permission when
> > > > > initalization. If the user don't have permission to load that
> record,
> > > > > the system will throw an exception and we will show an generic
> > > > > permission deny page.
> > > > >
> > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > > I'm not completely sure what you are asking. But, if you are
> asking if
> > > > you
> > > > > > can get the ResultSet itself that would be a no. iBATIS is JDBC
> wrapper.
> > > > If
> > > > > > you find that you need more direct access to JDBC then you should
> use
> > > > JDBC
> > > > > > directly.
> > > > > >
> > > > > >
> > > > > > Brandon
> > > > > >
> > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > Can I get the reference of resultset when the object is
> initalizating?
> > > > > > >
> > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > > You can find the javadoc here:
> > > > > > > >
> > > > > > > >
> > > > > >
> > > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > > > >
> > > > > > > > I was assuming you were wanting to map result values to a
> > > > constructor.
> > > > > > If
> > > > > > > > you are trying to map results to a constructor, it would seem
> a
> > > > tedious
> > > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > > >
> > > > > > > > I know it is lame that we don't have this functionality. But,
> we've
> > > > > > > > discussed adding the constructor mapping functionality and
> have
> > > > decided
> > > > > > it
> > > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > > >
> > > > > > > > Brandon
> > > > > > > >
> > > > > > > >
> > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > I just check for the document and I cannot see those APIs ,
> > > > > > > > > http://ibatis.apache.org/docs/java/user/ ,
> am I
> > > > > > looking
> > > > > > > > for wrong
> > > > > > > > > thing?
> > > > > > > > >
> > > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> wrote:
> > > > > > > > > > Have you considered using an implementation of
> > > > ResultObjectFactory?
> > > > > > It
> > > > > > > > can be configured within iBatis or injected into the
> > > > > > SqlMapExecutorDelegate.
> > > > > > > >  Either ways you will have control over the creation and
> subsequent
> > > > > > > > initialization of objects.
> > > > > > > > > >
> > > > > > > > > > ________________________________
> > > > > > > > > >
> > > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > > Subject: Re: Can ibatis work with java object with
> constructor
> > > > have
> > > > > > > > parameters?
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > You can do this using Spring. I think iBatis does not have
> to
> > > > > > support
> > > > > > > > this.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > > >
> > > > > > > > > >         To bad to hear that, is it planned to be
> implemented?
> > > > > > > > > >
> > > > > > > > > >         On 1/8/07, Brandon Goodin <
> brandon.goodin@gmail.com>
> > > > wrote:
> > > > > > > > > >         > This is not currently implemented.
> > > > > > > > > >         >
> > > > > > > > > >         > Brandon
> > > > > > > > > >         >
> > > > > > > > > >         >
> > > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > > >         > > I like to pass something to the object while
> > > > > > initalization,
> > > > > > > > can I
> > > > > > > > > >         > > specific about that?
> > > > > > > > > >         > >
> > > > > > > > > >         >
> > > > > > > > > >         >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Brandon Goodin <br...@gmail.com>.
Do you mean the TypeHandlerCallback which has a method called
getResult(ResultGetter). From the ResultGetter.getResultSet() you could get
the ResultSet. But, again this seems like a HUGE hack to accomplsh what is
desired.

Brandon

On 1/8/07, Clinton Begin <cl...@gmail.com> wrote:
>
> Except for that new method Larry added to the RowHandler APIs...you can
> now get the original ResultSet while the rows are being returned from within
> a RowHandler.
>
> But other than that very isolated case, Brandon is right, you can't just
> arbitrarily get the ResultSet and do with it as you please.
>
> Cheers,
> Clinton
>
> On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> >
> > No you cannot get a ResultSet. iBATIS will not at anytime from anywhere
> > provide you a reference to the ResultSet.
> >
> > Brandon
> >
> > On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> > >
> > > Just really read
> > > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > >
> > > , However can I get the resultset from the RowHandler?
> > >
> > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > Sounds like you can use a RowHandler for this.
> > > >
> > > >
> > > > Brandon
> > > >
> > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > Actually I get I cannot do... but anyway, just ask.
> > > > >
> > > > > For method
> > > >
> > > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String<http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance%28java.lang.String>
> > > ,
> > > > > java.lang.Class)
> > > > >
> > > > > instead of having
> > > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > Class[]{String.class});
> > > > >     return con.newInstance(objectStaticAvailable);
> > > > > }
> > > > >
> > > > > Can I init the object using resultset result, like
> > > > >
> > > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> > > clazz) {
> > > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > > Class[]{String.class});
> > > > >     return con.newInstance(rs.getString("id"));
> > > > > }
> > > > >
> > > > > So that I can use the ID of the record to check for permission
> > > when
> > > > > initalization. If the user don't have permission to load that
> > > record,
> > > > > the system will throw an exception and we will show an generic
> > > > > permission deny page.
> > > > >
> > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > > I'm not completely sure what you are asking. But, if you are
> > > asking if
> > > > you
> > > > > > can get the ResultSet itself that would be a no. iBATIS is JDBC
> > > wrapper.
> > > > If
> > > > > > you find that you need more direct access to JDBC then you
> > > should use
> > > > JDBC
> > > > > > directly.
> > > > > >
> > > > > >
> > > > > > Brandon
> > > > > >
> > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > Can I get the reference of resultset when the object is
> > > initalizating?
> > > > > > >
> > > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > > You can find the javadoc here:
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > >
> > > > > > > >
> > > > > > > > I was assuming you were wanting to map result values to a
> > > > constructor.
> > > > > > If
> > > > > > > > you are trying to map results to a constructor, it would
> > > seem a
> > > > tedious
> > > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > > >
> > > > > > > > I know it is lame that we don't have this functionality.
> > > But, we've
> > > > > > > > discussed adding the constructor mapping functionality and
> > > have
> > > > decided
> > > > > > it
> > > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > > >
> > > > > > > > Brandon
> > > > > > > >
> > > > > > > >
> > > > > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > > > > I just check for the document and I cannot see those APIs
> > > ,
> > > > > > > > > http://ibatis.apache.org/docs/java/user/ , am I
> > > > > > looking
> > > > > > > > for wrong
> > > > > > > > > thing?
> > > > > > > > >
> > > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> > > wrote:
> > > > > > > > > > Have you considered using an implementation of
> > > > ResultObjectFactory?
> > > > > > It
> > > > > > > > can be configured within iBatis or injected into the
> > > > > > SqlMapExecutorDelegate.
> > > > > > > >  Either ways you will have control over the creation and
> > > subsequent
> > > > > > > > initialization of objects.
> > > > > > > > > >
> > > > > > > > > > ________________________________
> > > > > > > > > >
> > > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > > Subject: Re: Can ibatis work with java object with
> > > constructor
> > > > have
> > > > > > > > parameters?
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > You can do this using Spring. I think iBatis does not
> > > have to
> > > > > > support
> > > > > > > > this.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > > >
> > > > > > > > > >         To bad to hear that, is it planned to be
> > > implemented?
> > > > > > > > > >
> > > > > > > > > >         On 1/8/07, Brandon Goodin <
> > > brandon.goodin@gmail.com>
> > > > wrote:
> > > > > > > > > >         > This is not currently implemented.
> > > > > > > > > >         >
> > > > > > > > > >         > Brandon
> > > > > > > > > >         >
> > > > > > > > > >         >
> > > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > > >         > > I like to pass something to the object while
> > >
> > > > > > initalization,
> > > > > > > > can I
> > > > > > > > > >         > > specific about that?
> > > > > > > > > >         > >
> > > > > > > > > >         >
> > > > > > > > > >         >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Clinton Begin <cl...@gmail.com>.
Except for that new method Larry added to the RowHandler APIs...you can now
get the original ResultSet while the rows are being returned from within a
RowHandler.

But other than that very isolated case, Brandon is right, you can't just
arbitrarily get the ResultSet and do with it as you please.

Cheers,
Clinton

On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
>
> No you cannot get a ResultSet. iBATIS will not at anytime from anywhere
> provide you a reference to the ResultSet.
>
> Brandon
>
> On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
> >
> > Just really read
> >
> > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> > , However can I get the resultset from the RowHandler?
> >
> > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > Sounds like you can use a RowHandler for this.
> > >
> > >
> > > Brandon
> > >
> > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > Actually I get I cannot do... but anyway, just ask.
> > > >
> > > > For method
> > >
> > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String<http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance%28java.lang.String>
> > ,
> > > > java.lang.Class)
> > > >
> > > > instead of having
> > > > public Object ResultObjectFactory(String id, Class clazz) {
> > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > Class[]{String.class});
> > > >     return con.newInstance(objectStaticAvailable);
> > > > }
> > > >
> > > > Can I init the object using resultset result, like
> > > >
> > > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> > clazz) {
> > > >     Constructor con = clazz.getDeclaredConstructor(new
> > > Class[]{String.class});
> > > >     return con.newInstance(rs.getString("id"));
> > > > }
> > > >
> > > > So that I can use the ID of the record to check for permission when
> > > > initalization. If the user don't have permission to load that
> > record,
> > > > the system will throw an exception and we will show an generic
> > > > permission deny page.
> > > >
> > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com > wrote:
> > > > > I'm not completely sure what you are asking. But, if you are
> > asking if
> > > you
> > > > > can get the ResultSet itself that would be a no. iBATIS is JDBC
> > wrapper.
> > > If
> > > > > you find that you need more direct access to JDBC then you should
> > use
> > > JDBC
> > > > > directly.
> > > > >
> > > > >
> > > > > Brandon
> > > > >
> > > > > On 1/7/07, Carfield Yim < carfield@gmail.com> wrote:
> > > > > > Can I get the reference of resultset when the object is
> > initalizating?
> > > > > >
> > > > > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > > > > You can find the javadoc here:
> > > > > > >
> > > > > > >
> > > > >
> > >
> > http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > > >
> > > > > > > I was assuming you were wanting to map result values to a
> > > constructor.
> > > > > If
> > > > > > > you are trying to map results to a constructor, it would seem
> > a
> > > tedious
> > > > > > > effort to use the ResultObjectFactory for this.
> > > > > > >
> > > > > > > I know it is lame that we don't have this functionality. But,
> > we've
> > > > > > > discussed adding the constructor mapping functionality and
> > have
> > > decided
> > > > > it
> > > > > > > is best to delay adding it until iB3 (no eta).
> > > > > > >
> > > > > > > Brandon
> > > > > > >
> > > > > > >
> > > > > > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > > > > I just check for the document and I cannot see those APIs ,
> > > > > > > > http://ibatis.apache.org/docs/java/user/ , am I
> > > > > looking
> > > > > > > for wrong
> > > > > > > > thing?
> > > > > > > >
> > > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> > wrote:
> > > > > > > > > Have you considered using an implementation of
> > > ResultObjectFactory?
> > > > > It
> > > > > > > can be configured within iBatis or injected into the
> > > > > SqlMapExecutorDelegate.
> > > > > > >  Either ways you will have control over the creation and
> > subsequent
> > > > > > > initialization of objects.
> > > > > > > > >
> > > > > > > > > ________________________________
> > > > > > > > >
> > > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > > Subject: Re: Can ibatis work with java object with
> > constructor
> > > have
> > > > > > > parameters?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > You can do this using Spring. I think iBatis does not have
> > to
> > > > > support
> > > > > > > this.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > > >
> > > > > > > > >         To bad to hear that, is it planned to be
> > implemented?
> > > > > > > > >
> > > > > > > > >         On 1/8/07, Brandon Goodin <
> > brandon.goodin@gmail.com>
> > > wrote:
> > > > > > > > >         > This is not currently implemented.
> > > > > > > > >         >
> > > > > > > > >         > Brandon
> > > > > > > > >         >
> > > > > > > > >         >
> > > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > > >         > > I like to pass something to the object while
> > > > > initalization,
> > > > > > > can I
> > > > > > > > >         > > specific about that?
> > > > > > > > >         > >
> > > > > > > > >         >
> > > > > > > > >         >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Brandon Goodin <br...@gmail.com>.
No you cannot get a ResultSet. iBATIS will not at anytime from anywhere
provide you a reference to the ResultSet.

Brandon

On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
>
> Just really read
>
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
> , However can I get the resultset from the RowHandler?
>
> On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > Sounds like you can use a RowHandler for this.
> >
> >
> > Brandon
> >
> > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > Actually I get I cannot do... but anyway, just ask.
> > >
> > > For method
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String
> ,
> > > java.lang.Class)
> > >
> > > instead of having
> > > public Object ResultObjectFactory(String id, Class clazz) {
> > >     Constructor con = clazz.getDeclaredConstructor(new
> > Class[]{String.class});
> > >     return con.newInstance(objectStaticAvailable);
> > > }
> > >
> > > Can I init the object using resultset result, like
> > >
> > > public Object ResultObjectFactory(String id, ResultSet rs, Class
> clazz) {
> > >     Constructor con = clazz.getDeclaredConstructor(new
> > Class[]{String.class});
> > >     return con.newInstance(rs.getString("id"));
> > > }
> > >
> > > So that I can use the ID of the record to check for permission when
> > > initalization. If the user don't have permission to load that record,
> > > the system will throw an exception and we will show an generic
> > > permission deny page.
> > >
> > > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > I'm not completely sure what you are asking. But, if you are asking
> if
> > you
> > > > can get the ResultSet itself that would be a no. iBATIS is JDBC
> wrapper.
> > If
> > > > you find that you need more direct access to JDBC then you should
> use
> > JDBC
> > > > directly.
> > > >
> > > >
> > > > Brandon
> > > >
> > > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > Can I get the reference of resultset when the object is
> initalizating?
> > > > >
> > > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > > You can find the javadoc here:
> > > > > >
> > > > > >
> > > >
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > > >
> > > > > > I was assuming you were wanting to map result values to a
> > constructor.
> > > > If
> > > > > > you are trying to map results to a constructor, it would seem a
> > tedious
> > > > > > effort to use the ResultObjectFactory for this.
> > > > > >
> > > > > > I know it is lame that we don't have this functionality. But,
> we've
> > > > > > discussed adding the constructor mapping functionality and have
> > decided
> > > > it
> > > > > > is best to delay adding it until iB3 (no eta).
> > > > > >
> > > > > > Brandon
> > > > > >
> > > > > >
> > > > > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > > > I just check for the document and I cannot see those APIs ,
> > > > > > > http://ibatis.apache.org/docs/java/user/ , am I
> > > > looking
> > > > > > for wrong
> > > > > > > thing?
> > > > > > >
> > > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com>
> wrote:
> > > > > > > > Have you considered using an implementation of
> > ResultObjectFactory?
> > > > It
> > > > > > can be configured within iBatis or injected into the
> > > > SqlMapExecutorDelegate.
> > > > > >  Either ways you will have control over the creation and
> subsequent
> > > > > > initialization of objects.
> > > > > > > >
> > > > > > > > ________________________________
> > > > > > > >
> > > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > > To: user-java@ibatis.apache.org
> > > > > > > > Subject: Re: Can ibatis work with java object with
> constructor
> > have
> > > > > > parameters?
> > > > > > > >
> > > > > > > >
> > > > > > > > You can do this using Spring. I think iBatis does not have
> to
> > > > support
> > > > > > this.
> > > > > > > >
> > > > > > > >
> > > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > > >
> > > > > > > >         To bad to hear that, is it planned to be
> implemented?
> > > > > > > >
> > > > > > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com
> >
> > wrote:
> > > > > > > >         > This is not currently implemented.
> > > > > > > >         >
> > > > > > > >         > Brandon
> > > > > > > >         >
> > > > > > > >         >
> > > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > > >         > > I like to pass something to the object while
> > > > initalization,
> > > > > > can I
> > > > > > > >         > > specific about that?
> > > > > > > >         > >
> > > > > > > >         >
> > > > > > > >         >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
Just really read
http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/client/event/RowHandler.html
, However can I get the resultset from the RowHandler?

On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> Sounds like you can use a RowHandler for this.
>
>
> Brandon
>
> On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > Actually I get I cannot do... but anyway, just ask.
> >
> > For method
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
> > java.lang.Class)
> >
> > instead of having
> > public Object ResultObjectFactory(String id, Class clazz) {
> >     Constructor con = clazz.getDeclaredConstructor(new
> Class[]{String.class});
> >     return con.newInstance(objectStaticAvailable);
> > }
> >
> > Can I init the object using resultset result, like
> >
> > public Object ResultObjectFactory(String id, ResultSet rs, Class clazz) {
> >     Constructor con = clazz.getDeclaredConstructor(new
> Class[]{String.class});
> >     return con.newInstance(rs.getString("id"));
> > }
> >
> > So that I can use the ID of the record to check for permission when
> > initalization. If the user don't have permission to load that record,
> > the system will throw an exception and we will show an generic
> > permission deny page.
> >
> > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > I'm not completely sure what you are asking. But, if you are asking if
> you
> > > can get the ResultSet itself that would be a no. iBATIS is JDBC wrapper.
> If
> > > you find that you need more direct access to JDBC then you should use
> JDBC
> > > directly.
> > >
> > >
> > > Brandon
> > >
> > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > Can I get the reference of resultset when the object is initalizating?
> > > >
> > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > You can find the javadoc here:
> > > > >
> > > > >
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > >
> > > > > I was assuming you were wanting to map result values to a
> constructor.
> > > If
> > > > > you are trying to map results to a constructor, it would seem a
> tedious
> > > > > effort to use the ResultObjectFactory for this.
> > > > >
> > > > > I know it is lame that we don't have this functionality. But, we've
> > > > > discussed adding the constructor mapping functionality and have
> decided
> > > it
> > > > > is best to delay adding it until iB3 (no eta).
> > > > >
> > > > > Brandon
> > > > >
> > > > >
> > > > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > > I just check for the document and I cannot see those APIs ,
> > > > > > http://ibatis.apache.org/docs/java/user/ , am I
> > > looking
> > > > > for wrong
> > > > > > thing?
> > > > > >
> > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com> wrote:
> > > > > > > Have you considered using an implementation of
> ResultObjectFactory?
> > > It
> > > > > can be configured within iBatis or injected into the
> > > SqlMapExecutorDelegate.
> > > > >  Either ways you will have control over the creation and subsequent
> > > > > initialization of objects.
> > > > > > >
> > > > > > > ________________________________
> > > > > > >
> > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > To: user-java@ibatis.apache.org
> > > > > > > Subject: Re: Can ibatis work with java object with constructor
> have
> > > > > parameters?
> > > > > > >
> > > > > > >
> > > > > > > You can do this using Spring. I think iBatis does not have to
> > > support
> > > > > this.
> > > > > > >
> > > > > > >
> > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > >
> > > > > > >         To bad to hear that, is it planned to be implemented?
> > > > > > >
> > > > > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com>
> wrote:
> > > > > > >         > This is not currently implemented.
> > > > > > >         >
> > > > > > >         > Brandon
> > > > > > >         >
> > > > > > >         >
> > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > >         > > I like to pass something to the object while
> > > initalization,
> > > > > can I
> > > > > > >         > > specific about that?
> > > > > > >         > >
> > > > > > >         >
> > > > > > >         >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
In fact that sound like what I really need, thanks for pointing out that

On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> Sounds like you can use a RowHandler for this.
>
>
> Brandon
>
> On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > Actually I get I cannot do... but anyway, just ask.
> >
> > For method
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
> > java.lang.Class)
> >
> > instead of having
> > public Object ResultObjectFactory(String id, Class clazz) {
> >     Constructor con = clazz.getDeclaredConstructor(new
> Class[]{String.class});
> >     return con.newInstance(objectStaticAvailable);
> > }
> >
> > Can I init the object using resultset result, like
> >
> > public Object ResultObjectFactory(String id, ResultSet rs, Class clazz) {
> >     Constructor con = clazz.getDeclaredConstructor(new
> Class[]{String.class});
> >     return con.newInstance(rs.getString("id"));
> > }
> >
> > So that I can use the ID of the record to check for permission when
> > initalization. If the user don't have permission to load that record,
> > the system will throw an exception and we will show an generic
> > permission deny page.
> >
> > On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > I'm not completely sure what you are asking. But, if you are asking if
> you
> > > can get the ResultSet itself that would be a no. iBATIS is JDBC wrapper.
> If
> > > you find that you need more direct access to JDBC then you should use
> JDBC
> > > directly.
> > >
> > >
> > > Brandon
> > >
> > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > Can I get the reference of resultset when the object is initalizating?
> > > >
> > > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > > You can find the javadoc here:
> > > > >
> > > > >
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > > >
> > > > > I was assuming you were wanting to map result values to a
> constructor.
> > > If
> > > > > you are trying to map results to a constructor, it would seem a
> tedious
> > > > > effort to use the ResultObjectFactory for this.
> > > > >
> > > > > I know it is lame that we don't have this functionality. But, we've
> > > > > discussed adding the constructor mapping functionality and have
> decided
> > > it
> > > > > is best to delay adding it until iB3 (no eta).
> > > > >
> > > > > Brandon
> > > > >
> > > > >
> > > > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > > I just check for the document and I cannot see those APIs ,
> > > > > > http://ibatis.apache.org/docs/java/user/ , am I
> > > looking
> > > > > for wrong
> > > > > > thing?
> > > > > >
> > > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com> wrote:
> > > > > > > Have you considered using an implementation of
> ResultObjectFactory?
> > > It
> > > > > can be configured within iBatis or injected into the
> > > SqlMapExecutorDelegate.
> > > > >  Either ways you will have control over the creation and subsequent
> > > > > initialization of objects.
> > > > > > >
> > > > > > > ________________________________
> > > > > > >
> > > > > > > From: Peng Wang [mailto: wpcfan@gmail.com ]
> > > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > > To: user-java@ibatis.apache.org
> > > > > > > Subject: Re: Can ibatis work with java object with constructor
> have
> > > > > parameters?
> > > > > > >
> > > > > > >
> > > > > > > You can do this using Spring. I think iBatis does not have to
> > > support
> > > > > this.
> > > > > > >
> > > > > > >
> > > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > > >
> > > > > > >         To bad to hear that, is it planned to be implemented?
> > > > > > >
> > > > > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com>
> wrote:
> > > > > > >         > This is not currently implemented.
> > > > > > >         >
> > > > > > >         > Brandon
> > > > > > >         >
> > > > > > >         >
> > > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > > <mailto: carfield@gmail.com> > wrote:
> > > > > > >         > > I like to pass something to the object while
> > > initalization,
> > > > > can I
> > > > > > >         > > specific about that?
> > > > > > >         > >
> > > > > > >         >
> > > > > > >         >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Brandon Goodin <br...@gmail.com>.
Sounds like you can use a RowHandler for this.

Brandon

On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
>
> Actually I get I cannot do... but anyway, just ask.
>
> For method
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String
> ,
> java.lang.Class)
>
> instead of having
> public Object ResultObjectFactory(String id, Class clazz) {
>     Constructor con = clazz.getDeclaredConstructor(new Class[]{
> String.class});
>     return con.newInstance(objectStaticAvailable);
> }
>
> Can I init the object using resultset result, like
>
> public Object ResultObjectFactory(String id, ResultSet rs, Class clazz) {
>     Constructor con = clazz.getDeclaredConstructor(new Class[]{
> String.class});
>     return con.newInstance(rs.getString("id"));
> }
>
> So that I can use the ID of the record to check for permission when
> initalization. If the user don't have permission to load that record,
> the system will throw an exception and we will show an generic
> permission deny page.
>
> On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > I'm not completely sure what you are asking. But, if you are asking if
> you
> > can get the ResultSet itself that would be a no. iBATIS is JDBC wrapper.
> If
> > you find that you need more direct access to JDBC then you should use
> JDBC
> > directly.
> >
> >
> > Brandon
> >
> > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > Can I get the reference of resultset when the object is initalizating?
> > >
> > > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > > You can find the javadoc here:
> > > >
> > > >
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > > >
> > > > I was assuming you were wanting to map result values to a
> constructor.
> > If
> > > > you are trying to map results to a constructor, it would seem a
> tedious
> > > > effort to use the ResultObjectFactory for this.
> > > >
> > > > I know it is lame that we don't have this functionality. But, we've
> > > > discussed adding the constructor mapping functionality and have
> decided
> > it
> > > > is best to delay adding it until iB3 (no eta).
> > > >
> > > > Brandon
> > > >
> > > >
> > > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > > I just check for the document and I cannot see those APIs ,
> > > > > http://ibatis.apache.org/docs/java/user/ , am I
> > looking
> > > > for wrong
> > > > > thing?
> > > > >
> > > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com> wrote:
> > > > > > Have you considered using an implementation of
> ResultObjectFactory?
> > It
> > > > can be configured within iBatis or injected into the
> > SqlMapExecutorDelegate.
> > > >  Either ways you will have control over the creation and subsequent
> > > > initialization of objects.
> > > > > >
> > > > > > ________________________________
> > > > > >
> > > > > > From: Peng Wang [mailto: wpcfan@gmail.com]
> > > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > > To: user-java@ibatis.apache.org
> > > > > > Subject: Re: Can ibatis work with java object with constructor
> have
> > > > parameters?
> > > > > >
> > > > > >
> > > > > > You can do this using Spring. I think iBatis does not have to
> > support
> > > > this.
> > > > > >
> > > > > >
> > > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > > >
> > > > > >         To bad to hear that, is it planned to be implemented?
> > > > > >
> > > > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com>
> wrote:
> > > > > >         > This is not currently implemented.
> > > > > >         >
> > > > > >         > Brandon
> > > > > >         >
> > > > > >         >
> > > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > > <mailto: carfield@gmail.com> > wrote:
> > > > > >         > > I like to pass something to the object while
> > initalization,
> > > > can I
> > > > > >         > > specific about that?
> > > > > >         > >
> > > > > >         >
> > > > > >         >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Larry Meadors <lm...@apache.org>.
You would use iBATIS - it's using your SQL, no?

If it is using your SQL, in your SELECT statement, you can exclude
records based on anything in the result set using a WHERE or HAVING
clause.

Larry


PS: iBATIS is not an ORM tool, it's a data mapper. ;-)


On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> On 1/8/07, Larry Meadors <lm...@apache.org> wrote:
> > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > So that I can use the ID of the record to check for permission when
> > > initalization. If the user don't have permission to load that record,
> > > the system will throw an exception and we will show an generic
> > > permission deny page.
> >
> > It seems like this would be way more efficient to do in the SQL.
> >
> > That way you don't have any overhead (i.e., network latency, object
> > creation, etc..).
> >
> > Larry
> >
> But it is probably better to work in ibatis as my boss like to
> standardize to use this ORM framework
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
On 1/8/07, Larry Meadors <lm...@apache.org> wrote:
> On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > So that I can use the ID of the record to check for permission when
> > initalization. If the user don't have permission to load that record,
> > the system will throw an exception and we will show an generic
> > permission deny page.
>
> It seems like this would be way more efficient to do in the SQL.
>
> That way you don't have any overhead (i.e., network latency, object
> creation, etc..).
>
> Larry
>
But it is probably better to work in ibatis as my boss like to
standardize to use this ORM framework

Re: Can ibatis work with java object with constructor have parameters?

Posted by Larry Meadors <lm...@apache.org>.
On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> So that I can use the ID of the record to check for permission when
> initalization. If the user don't have permission to load that record,
> the system will throw an exception and we will show an generic
> permission deny page.

It seems like this would be way more efficient to do in the SQL.

That way you don't have any overhead (i.e., network latency, object
creation, etc..).

Larry

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
Actually I get I cannot do... but anyway, just ask.

For method http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html#createInstance(java.lang.String,
java.lang.Class)

instead of having
public Object ResultObjectFactory(String id, Class clazz) {
    Constructor con = clazz.getDeclaredConstructor(new Class[]{String.class});
    return con.newInstance(objectStaticAvailable);
}

Can I init the object using resultset result, like

public Object ResultObjectFactory(String id, ResultSet rs, Class clazz) {
    Constructor con = clazz.getDeclaredConstructor(new Class[]{String.class});
    return con.newInstance(rs.getString("id"));
}

So that I can use the ID of the record to check for permission when
initalization. If the user don't have permission to load that record,
the system will throw an exception and we will show an generic
permission deny page.

On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> I'm not completely sure what you are asking. But, if you are asking if you
> can get the ResultSet itself that would be a no. iBATIS is JDBC wrapper. If
> you find that you need more direct access to JDBC then you should use JDBC
> directly.
>
>
> Brandon
>
> On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > Can I get the reference of resultset when the object is initalizating?
> >
> > On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > > You can find the javadoc here:
> > >
> > >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> > >
> > > I was assuming you were wanting to map result values to a constructor.
> If
> > > you are trying to map results to a constructor, it would seem a tedious
> > > effort to use the ResultObjectFactory for this.
> > >
> > > I know it is lame that we don't have this functionality. But, we've
> > > discussed adding the constructor mapping functionality and have decided
> it
> > > is best to delay adding it until iB3 (no eta).
> > >
> > > Brandon
> > >
> > >
> > > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > > I just check for the document and I cannot see those APIs ,
> > > > http://ibatis.apache.org/docs/java/user/ , am I
> looking
> > > for wrong
> > > > thing?
> > > >
> > > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com> wrote:
> > > > > Have you considered using an implementation of ResultObjectFactory?
> It
> > > can be configured within iBatis or injected into the
> SqlMapExecutorDelegate.
> > >  Either ways you will have control over the creation and subsequent
> > > initialization of objects.
> > > > >
> > > > > ________________________________
> > > > >
> > > > > From: Peng Wang [mailto: wpcfan@gmail.com]
> > > > > Sent: Sun 1/7/2007 9:26 PM
> > > > > To: user-java@ibatis.apache.org
> > > > > Subject: Re: Can ibatis work with java object with constructor have
> > > parameters?
> > > > >
> > > > >
> > > > > You can do this using Spring. I think iBatis does not have to
> support
> > > this.
> > > > >
> > > > >
> > > > > On 1/8/07, Carfield Yim < carfield@gmail.com > wrote:
> > > > >
> > > > >         To bad to hear that, is it planned to be implemented?
> > > > >
> > > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > > >         > This is not currently implemented.
> > > > >         >
> > > > >         > Brandon
> > > > >         >
> > > > >         >
> > > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > > <mailto: carfield@gmail.com> > wrote:
> > > > >         > > I like to pass something to the object while
> initalization,
> > > can I
> > > > >         > > specific about that?
> > > > >         > >
> > > > >         >
> > > > >         >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Brandon Goodin <br...@gmail.com>.
I'm not completely sure what you are asking. But, if you are asking if you
can get the ResultSet itself that would be a no. iBATIS is JDBC wrapper. If
you find that you need more direct access to JDBC then you should use JDBC
directly.

Brandon

On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
>
> Can I get the reference of resultset when the object is initalizating?
>
> On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > You can find the javadoc here:
> >
> >
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
> >
> > I was assuming you were wanting to map result values to a constructor.
> If
> > you are trying to map results to a constructor, it would seem a tedious
> > effort to use the ResultObjectFactory for this.
> >
> > I know it is lame that we don't have this functionality. But, we've
> > discussed adding the constructor mapping functionality and have decided
> it
> > is best to delay adding it until iB3 (no eta).
> >
> > Brandon
> >
> >
> > On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > > I just check for the document and I cannot see those APIs ,
> > > http://ibatis.apache.org/docs/java/user/ , am I looking
> > for wrong
> > > thing?
> > >
> > > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com> wrote:
> > > > Have you considered using an implementation of
> ResultObjectFactory?  It
> > can be configured within iBatis or injected into the
> SqlMapExecutorDelegate.
> >  Either ways you will have control over the creation and subsequent
> > initialization of objects.
> > > >
> > > > ________________________________
> > > >
> > > > From: Peng Wang [mailto:wpcfan@gmail.com]
> > > > Sent: Sun 1/7/2007 9:26 PM
> > > > To: user-java@ibatis.apache.org
> > > > Subject: Re: Can ibatis work with java object with constructor have
> > parameters?
> > > >
> > > >
> > > > You can do this using Spring. I think iBatis does not have to
> support
> > this.
> > > >
> > > >
> > > > On 1/8/07, Carfield Yim <carfield@gmail.com > wrote:
> > > >
> > > >         To bad to hear that, is it planned to be implemented?
> > > >
> > > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > > >         > This is not currently implemented.
> > > >         >
> > > >         > Brandon
> > > >         >
> > > >         >
> > > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> > <ma...@gmail.com> > wrote:
> > > >         > > I like to pass something to the object while
> initalization,
> > can I
> > > >         > > specific about that?
> > > >         > >
> > > >         >
> > > >         >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
Can I get the reference of resultset when the object is initalizating?

On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> You can find the javadoc here:
>
> http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html
>
> I was assuming you were wanting to map result values to a constructor. If
> you are trying to map results to a constructor, it would seem a tedious
> effort to use the ResultObjectFactory for this.
>
> I know it is lame that we don't have this functionality. But, we've
> discussed adding the constructor mapping functionality and have decided it
> is best to delay adding it until iB3 (no eta).
>
> Brandon
>
>
> On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
> > I just check for the document and I cannot see those APIs ,
> > http://ibatis.apache.org/docs/java/user/ , am I looking
> for wrong
> > thing?
> >
> > On 1/8/07, Goga, Murtaza < murtaza.goga@trisyngroup.com> wrote:
> > > Have you considered using an implementation of ResultObjectFactory?  It
> can be configured within iBatis or injected into the SqlMapExecutorDelegate.
>  Either ways you will have control over the creation and subsequent
> initialization of objects.
> > >
> > > ________________________________
> > >
> > > From: Peng Wang [mailto:wpcfan@gmail.com]
> > > Sent: Sun 1/7/2007 9:26 PM
> > > To: user-java@ibatis.apache.org
> > > Subject: Re: Can ibatis work with java object with constructor have
> parameters?
> > >
> > >
> > > You can do this using Spring. I think iBatis does not have to support
> this.
> > >
> > >
> > > On 1/8/07, Carfield Yim <carfield@gmail.com > wrote:
> > >
> > >         To bad to hear that, is it planned to be implemented?
> > >
> > >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> > >         > This is not currently implemented.
> > >         >
> > >         > Brandon
> > >         >
> > >         >
> > >         > On 1/6/07, Carfield Yim < carfield@gmail.com
> <ma...@gmail.com> > wrote:
> > >         > > I like to pass something to the object while initalization,
> can I
> > >         > > specific about that?
> > >         > >
> > >         >
> > >         >
> > >
> > >
> > >
> > >
> > >
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Brandon Goodin <br...@gmail.com>.
You can find the javadoc here:

http://ibatis.apache.org/docs/java/dev/com/ibatis/sqlmap/engine/mapping/result/ResultObjectFactory.html

I was assuming you were wanting to map result values to a constructor. If
you are trying to map results to a constructor, it would seem a tedious
effort to use the ResultObjectFactory for this.

I know it is lame that we don't have this functionality. But, we've
discussed adding the constructor mapping functionality and have decided it
is best to delay adding it until iB3 (no eta).

Brandon

On 1/7/07, Carfield Yim <ca...@gmail.com> wrote:
>
> I just check for the document and I cannot see those APIs ,
> http://ibatis.apache.org/docs/java/user/ , am I looking for wrong
> thing?
>
> On 1/8/07, Goga, Murtaza <mu...@trisyngroup.com> wrote:
> > Have you considered using an implementation of ResultObjectFactory?  It
> can be configured within iBatis or injected into the
> SqlMapExecutorDelegate.  Either ways you will have control over the creation
> and subsequent initialization of objects.
> >
> > ________________________________
> >
> > From: Peng Wang [mailto:wpcfan@gmail.com]
> > Sent: Sun 1/7/2007 9:26 PM
> > To: user-java@ibatis.apache.org
> > Subject: Re: Can ibatis work with java object with constructor have
> parameters?
> >
> >
> > You can do this using Spring. I think iBatis does not have to support
> this.
> >
> >
> > On 1/8/07, Carfield Yim <carfield@gmail.com > wrote:
> >
> >         To bad to hear that, is it planned to be implemented?
> >
> >         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
> >         > This is not currently implemented.
> >         >
> >         > Brandon
> >         >
> >         >
> >         > On 1/6/07, Carfield Yim < carfield@gmail.com <mailto:
> carfield@gmail.com> > wrote:
> >         > > I like to pass something to the object while initalization,
> can I
> >         > > specific about that?
> >         > >
> >         >
> >         >
> >
> >
> >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
I just check for the document and I cannot see those APIs ,
http://ibatis.apache.org/docs/java/user/ , am I looking for wrong
thing?

On 1/8/07, Goga, Murtaza <mu...@trisyngroup.com> wrote:
> Have you considered using an implementation of ResultObjectFactory?  It can be configured within iBatis or injected into the SqlMapExecutorDelegate.  Either ways you will have control over the creation and subsequent initialization of objects.
>
> ________________________________
>
> From: Peng Wang [mailto:wpcfan@gmail.com]
> Sent: Sun 1/7/2007 9:26 PM
> To: user-java@ibatis.apache.org
> Subject: Re: Can ibatis work with java object with constructor have parameters?
>
>
> You can do this using Spring. I think iBatis does not have to support this.
>
>
> On 1/8/07, Carfield Yim <carfield@gmail.com > wrote:
>
>         To bad to hear that, is it planned to be implemented?
>
>         On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
>         > This is not currently implemented.
>         >
>         > Brandon
>         >
>         >
>         > On 1/6/07, Carfield Yim < carfield@gmail.com <ma...@gmail.com> > wrote:
>         > > I like to pass something to the object while initalization, can I
>         > > specific about that?
>         > >
>         >
>         >
>
>
>
>
>

RE: Can ibatis work with java object with constructor have parameters?

Posted by "Goga, Murtaza" <mu...@trisyngroup.com>.
Have you considered using an implementation of ResultObjectFactory?  It can be configured within iBatis or injected into the SqlMapExecutorDelegate.  Either ways you will have control over the creation and subsequent initialization of objects.

________________________________

From: Peng Wang [mailto:wpcfan@gmail.com]
Sent: Sun 1/7/2007 9:26 PM
To: user-java@ibatis.apache.org
Subject: Re: Can ibatis work with java object with constructor have parameters?


You can do this using Spring. I think iBatis does not have to support this.


On 1/8/07, Carfield Yim <carfield@gmail.com > wrote: 

	To bad to hear that, is it planned to be implemented?
	
	On 1/8/07, Brandon Goodin < brandon.goodin@gmail.com> wrote:
	> This is not currently implemented.
	>
	> Brandon
	>
	>
	> On 1/6/07, Carfield Yim < carfield@gmail.com <ma...@gmail.com> > wrote:
	> > I like to pass something to the object while initalization, can I
	> > specific about that?
	> >
	>
	>
	



Re: Can ibatis work with java object with constructor have parameters?

Posted by Peng Wang <wp...@gmail.com>.
You can do this using Spring. I think iBatis does not have to support this.

On 1/8/07, Carfield Yim <ca...@gmail.com> wrote:
>
> To bad to hear that, is it planned to be implemented?
>
> On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> > This is not currently implemented.
> >
> > Brandon
> >
> >
> > On 1/6/07, Carfield Yim <ca...@gmail.com> wrote:
> > > I like to pass something to the object while initalization, can I
> > > specific about that?
> > >
> >
> >
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Carfield Yim <ca...@gmail.com>.
To bad to hear that, is it planned to be implemented?

On 1/8/07, Brandon Goodin <br...@gmail.com> wrote:
> This is not currently implemented.
>
> Brandon
>
>
> On 1/6/07, Carfield Yim <ca...@gmail.com> wrote:
> > I like to pass something to the object while initalization, can I
> > specific about that?
> >
>
>

Re: Can ibatis work with java object with constructor have parameters?

Posted by Brandon Goodin <br...@gmail.com>.
This is not currently implemented.

Brandon

On 1/6/07, Carfield Yim <ca...@gmail.com> wrote:
>
> I like to pass something to the object while initalization, can I
> specific about that?
>