Re: Parameterised constructors

2006-09-21 Thread Clinton Begin
No, you still need to write the setter, but make it private. Like this:public class Foo {

  private String
  foo;
  
  public String getFoo()
  {
   return
  foo;
  }
private void setFoo(String foo)
  {
   this.foo = foo;
  }
}On 9/20/06, MCCORMICK, Paul 
[EMAIL PROTECTED] wrote:




How do private setters work?
Could I set the 'foo' property using the result map below? Is there
anything I have to do to the jmv to allow it access to the private
field?

resultMap
class=Foo
 result
property=foo column=FOOBA
/resultMap

public class Foo {

  private String
  foo;
  
  public String getFoo()
  {
   return
  foo;
  }
}

Thanks,
Paul



From: Clinton Begin
[mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 September 2006
3:23 AMTo: user-java@ibatis.apache.orgSubject: Re:
Parameterised constructors
As a temporary alternative we do support private setters as of
2.2.0. Constructor injection is supported in the .NET
version. The two codebases are somewhat similar, so we could always check
on their approach to it. Clinton
On 9/18/06, Jeff
Butler [EMAIL PROTECTED] wrote:

  
  I remember some folks asking about this, but no commitment to do
  it. It would require quite a change to the way iBATIS processes result
  sets. Translation: don't expect this anytime soon.
  
  BTW, the Sun patterns web site has some information about an immutable
  transfer object pattern here:
  
  http://java.sun.com/blueprints/patterns/TransferObject.html
  
  The basic idea is that you create an interface for the immutable part,
  and a mutable static inner class for initializing. This does work with
  iBATIS. But one warning - we used this pattern on my team for a while
  and everyone (me included) HATED it. So we eventually went to simple
  JavaBeans with getters AND setters. 
  
  Jeff Butler
  
  
  On 9/18/06, [EMAIL PROTECTED] 
 [EMAIL PROTECTED]  wrote: 
  
  Mmm
... no that's not quite it.I have a set of VO classes that are
immutable. This means that all the data is added at
construction.|-+---|
| Larry
Meadors ||
|
[EMAIL PROTECTED]||
|
.org |
|
| Sent
by:||
|
[EMAIL PROTECTED]||
| ail.com
 |
|
|
||
|
| |
| 18/09/2006
13:10||
| Please
respond||
| to
user-java||
|
|
|-+--||
|
|To:user-java@ibatis.apache.org
|
|cc:(bcc:
Ray
Offiah/WRSYS/MANSERV/JLP)
| |Subject: Re:
Parameterised
constructors|
---|
  
  I am not
  finding docs for it at the moment, either. I think that the
  ResultObjectFactoryTest unit test does what you want. Take a look, and
  see - if it is, please feel free to add a page to the WIKI (http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home
  )on how to use it.LarryOn 9/18/06, [EMAIL PROTECTED] 

  [EMAIL PROTECTED] wrote: Hi
  there! I vaguely remember reading that parameterised
  constructors were being  considered for Ibatis. Is this still planned
  for a future release, or has  the idea been dropped? I
  noticed that there was no mention of them in the documentation for the
  latest beta, which is a bit of a shame (for me anyway; not sure how many
   others would find them useful) 
  **
  This email is confidential and may contain copyright material of the John
  Lewis Partnership. If you are not the intended recipient, please notify us
  immediately and delete all copies of this message. (Please note that it
  isyour responsibility to scan this message for viruses). Email to and from
  the John Lewis Partnership is automatically monitored for operational and
  lawful business reasons.
  **
  John Lewis plc Registered in England 233462  Registered
  office171 Victoria Street London SW1E 5NN 
  Websites: http://www.johnlewis.com 
http://www.waitrose.com
   http://www.johnlewispartnership.co.uk
  **
  **This
  email is confidential and may contain copyright material of the John Lewis
  Partnership. If you are not the intended recipient, please notify us
  immediately and delete all copies of this message. (Please note that it is
  your responsibility to scan this message for viruses). Email to and from the
  John Lewis Partnership is automatically monitored for operational and lawful
  business reasons.
  **John
  Lewis plcRegistered in England 233462Registered office171
  Victoria Street London SW1E 5NNWebsites: http

RE: Parameterised constructors

2006-09-21 Thread Niels Beekman








Concerning the jvm question: if you have a
security manager in place, you would need to have the AccessibleObject.ACCESS_PERMISSION
(suppressAccessChecks) permission.



Niels











From: MCCORMICK, Paul
[mailto:[EMAIL PROTECTED] 
Sent: donderdag 21 september 2006
5:00
To: user-java@ibatis.apache.org
Subject: RE: Parameterised
constructors





How do private
setters work? Could I set the 'foo' property using the result map
below? Is there anything I have to do to the jmv to allow it access to
the private field?



resultMap
class=Foo


result property=foo column=FOOBA

/resultMap



public class
Foo {



private String foo;



public String
getFoo() {


return foo;

}



}



Thanks,

Paul











From: Clinton
Begin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 19 September 2006
3:23 AM
To: user-java@ibatis.apache.org
Subject: Re: Parameterised
constructors

As a temporary
alternative we do support private setters as of 2.2.0. 

Constructor injection is supported in the .NET version. The two codebases
are somewhat similar, so we could always check on their approach to it. 

Clinton



On 9/18/06, Jeff
Butler [EMAIL PROTECTED]
wrote: 





I remember some folks asking about this, but no commitment to do
it. It would require quite a change to the way iBATIS processes result sets.
Translation: don't expect this anytime soon.











BTW, the Sun patterns web site has some information about an immutable
transfer object pattern here:











http://java.sun.com/blueprints/patterns/TransferObject.html











The basic idea is that you create an interface for the immutable part,
and a mutable static inner class for initializing. This does work with
iBATIS. But one warning - we used this pattern on my team for a while and
everyone (me included) HATED it. So we eventually went to simple
JavaBeans with getters AND setters. 











Jeff Butler












On 9/18/06, [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 wrote: 







Mmm ... no that's not quite it.

I have a set of VO classes that are immutable. This means that all the data 
is added at construction.



|-+---
|
| Larry
Meadors |
|
|
[EMAIL PROTECTED]|
|
|
.org | 
|
| Sent
by:|
|
| [EMAIL PROTECTED]|
|
| ail.com
 | 
|
|
|
|
|
| 
|
| 18/09/2006 13:10|
|
| Please
respond|
|
| to
user-java|
|
|
| 
|-+---
---|
|
| 
|To:user-java@ibatis.apache.org
| 
|cc:(bcc:
Ray Offiah/WRSYS/MANSERV/JLP)
| 
|Subject: Re: Parameterised
constructors|

---|













I am not finding docs for it at the moment, either. I think that
the 
ResultObjectFactoryTest unit test does what you want. Take a
look, and 
see - if it is, please feel free to add a page to the WIKI 
(http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home
)
on how to use it.

Larry


On 9/18/06, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:

 Hi there!

 I vaguely remember reading that parameterised constructors
were being 
 considered for Ibatis. Is this still planned for a future
release, or has 
 the idea been dropped?

 I noticed that there was no mention of them in the
documentation for the
 latest beta, which is a bit of a shame (for me anyway; not
sure how many 
 others would find them useful) 



 **
 This email is confidential and may contain copyright
material of the John 
Lewis Partnership. If you are not the intended recipient, please
notify us 
immediately and delete all copies of this message. (Please note
that it is
your responsibility to scan this message for viruses). Email to
and from 
the John Lewis Partnership is automatically monitored for
operational and 
lawful business reasons.
 **
 John Lewis plc
 Registered in England 233462 
 Registered office171 Victoria Street London
 SW1E 5NN 

 Websites: http://www.johnlewis.com
 http://www.waitrose.com

 http://www.johnlewispartnership.co.uk


** 






**
This email is confidential and may contain copyright material of
the John Lewis Partnership. If you are not the intended recipient, please
notify us immediately and delete all copies of this message. (Please note that
it is your responsibility to scan this message for viruses). Email to and from
the John Lewis Partnership is automatically monitored for operational and
lawful business reasons. 
**
John Lewis plc
Registered in England
233462
Registered office171 Victoria Street London
 SW1E 5NN

Websites: http://www.johnlewis.com
http://www.waitrose.com
http

RE: Parameterised constructors

2006-09-21 Thread MCCORMICK, Paul



Ah that explains what I was doing 
wrong.


From: Clinton Begin 
[mailto:[EMAIL PROTECTED] Sent: Thursday, 21 September 2006 
2:29 PMTo: user-java@ibatis.apache.orgSubject: Re: 
Parameterised constructors
No, you still need to write the setter, but make it private. 
Like this:
public class Foo {

  private String 
  foo;
  
  public String getFoo() {
   return foo;
  }
  private void setFoo(String foo) 
  {
   this.foo = foo;
  }
}
On 9/20/06, MCCORMICK, 
Paul  
[EMAIL PROTECTED] wrote:

  
  How do private setters work? Could I set the 'foo' property using 
  the result map below? Is there anything I have to do to the jmv to allow 
  it access to the private field?
  
  resultMap class="Foo"
   result property="foo" 
  column="FOOBA"
  /resultMap
  
  public class Foo {
  
private String foo;

public String getFoo() {
 return foo;
}
  }
  
  Thanks,
  Paul
  
  
  
  From: Clinton Begin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 19 
  September 2006 3:23 AMTo: user-java@ibatis.apache.orgSubject: Re: 
  Parameterised constructors
  
  As a temporary alternative we do support private setters as of 
  2.2.0. Constructor injection is supported in the .NET 
  version. The two codebases are somewhat similar, so we could always 
  check on their approach to it. Clinton
  On 9/18/06, Jeff 
  Butler [EMAIL PROTECTED] wrote: 
  

I remember some folks asking about this, but no commitment to do 
it. It would require quite a change to the way iBATIS processes result 
sets. Translation: don't expect this anytime soon.

BTW, the Sun patterns web site has some information about an immutable 
transfer object pattern here:

http://java.sun.com/blueprints/patterns/TransferObject.html

The basic idea is that you create an interface for the immutable part, 
and a mutable static inner class for initializing. This does work with 
iBATIS. But one warning - we used this pattern on my team for a while 
and everyone (me included) HATED it. So we eventually went to simple 
JavaBeans with getters AND setters. 

Jeff Butler


On 9/18/06, [EMAIL PROTECTED]  [EMAIL PROTECTED]  wrote: 

Mmm 
  ... no that's not quite it.I have a set of VO classes that are 
  immutable. This means that all the data is added at 
  construction.|-+---| 
  | "Larry 
  Meadors" || 
  | 
  [EMAIL PROTECTED]|| 
  | 
  .org | 
  | 
  | Sent 
  by:|| 
  | 
  [EMAIL PROTECTED]|| 
  | ail.com 
   | 
  | 
  | 
  || 
  | 
  | | 
  | 18/09/2006 
  13:10|| 
  | Please 
  respond|| 
  | to 
  user-java|| 
  | 
  | 
  |-+--|| 
  | 
  |To:user-java@ibatis.apache.org 
  | 
  |cc:(bcc: 
  Ray 
  Offiah/WRSYS/MANSERV/JLP) 
  | |Subject: Re: 
  Parameterised 
  constructors| 
  ---| 

I am not finding docs for it at the moment, 
either. I think that the ResultObjectFactoryTest unit test does what you 
want. Take a look, and see - if it is, please feel free to add a page to 
the WIKI (http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home 
)on how to use it.LarryOn 9/18/06, [EMAIL PROTECTED]  
[EMAIL PROTECTED] wrote: Hi 
there! I vaguely remember reading that parameterised 
constructors were being  considered for Ibatis. Is this still 
planned for a future release, or has  the idea been 
dropped? I noticed that there was no mention of them in the 
documentation for the latest beta, which is a bit of a shame (for me 
anyway; not sure how many  others would find them useful) 
 
** 
This email is confidential and may contain copyright material of the John 
Lewis Partnership. If you are not the intended recipient, please notify 
us immediately and delete all copies of this message. (Please note that 
it isyour responsibility to scan this message for viruses). Email to and 
from the John Lewis Partnership is automatically monitored for 
operational and lawful business reasons. 
** 
John Lewis plc Registered in England 233462  Registered 
office171 Victoria Street London SW1E 5NN  
Websites: http://www.johnlewis.com http://www.waitrose.com 
 http://www.johnlewispartnership.co.uk 
** 
**This 
email i

Re: Parameterised constructors

2006-09-21 Thread Clinton Begin
Nope, it just works. Note the security post by Niels earlier.-- Remember, we understand this isn't ideal. But it's better than public setters!Cheers,ClintonOn 9/19/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
It'll raise a few eyebrows but I'll see what the chaps say.Is there any documentation anywhere on using private setters? Do I need toadd something to the result map entries, and will I need to fiddle with the
JVM security manager?|-+---| | Clinton Begin || | [EMAIL PROTECTED]|| | 
mail.com || | || | 19/09/2006 15:11|| | Please respond|| | to user-java|| | |
|-+--|| |
|To:user-java@ibatis.apache.org ||cc:(bcc: Ray Offiah/WRSYS/MANSERV/JLP) |
|Subject: Re: Parameterised constructors|---|
I understand that you're using constructor injection and that they don'thave setters.What I'm suggesting is that you add private setters and a parameterlessconstructor.It won't have any impact on the immutability of your class.
It's a bit of extra code, but not uncommon.I know it's not ideal, but itwould work for the time being.Cheers,ClintonOn 9/19/06, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:The private setters is a nice addition, but not really helpful in oursituation because the fields actually don't have setters at all; the object
is filled in through the constructor call.I did pick up on some interesting conversations that you had with the theguy who wrote O/R Broker, which seems to have a nice pattern for dealingwith constructors and complex loading statements (like loading up a field
based on the contents of another field). Hopefully we'll see somethingsimilar in IBatis in the future.Thanks for your help ... :-)|-+---| | Clinton Begin |
| | [EMAIL PROTECTED] || | mail.com || | || | 18/09/2006 20:22|| | Please respond|
| | to user-java|| | ||-+--|
|||To:user-java@ibatis.apache.org||cc:(bcc: Ray Offiah/WRSYS/MANSERV/JLP)||Subject: Re: Parameterised constructors
|---|As a temporary alternative we do support private setters as of 2.2.0
.Constructor injection is supported in the .NET version.The two codebasesare somewhat similar, so we could always check on their approach to it.ClintonOn 9/18/06, Jeff Butler 
[EMAIL PROTECTED] wrote:I remember some folks asking about this, but no commitment to do it.Itwould require quite a change to the way iBATIS processes result sets.Translation: don't expect this anytime soon.
BTW, the Sun patterns web site has some information about an immutabletransfer object pattern here:http://java.sun.com/blueprints/patterns/TransferObject.html
The basic idea is that you create an interface for the immutable part, anda mutable static inner class for initializing.This does work with iBATIS.But one warning - we used this pattern on my team for a while and everyone
(me included) HATED it.So we eventually went to simple JavaBeans withgetters AND setters.Jeff ButlerOn 9/18/06, [EMAIL PROTECTED]  
[EMAIL PROTECTED]  wrote:Mmm ... no that's not quite it.I have a set of VO classes that are immutable. This means that all the datais added at construction.|-+---
| | Larry Meadors || | [EMAIL PROTECTED]|| | .org || | Sent by:|| | [EMAIL PROTECTED]
|| | ail.com|| | || | || | 18/09/2006 13:10|| | Please respond|
| | to user-java|| | ||-+--|
|||To:user-java@ibatis.apache.org||cc:(bcc: Ray Offiah/WRSYS/MANSERV/JLP)||Subject: Re: Parameterised constructors
|---|I am not finding docs for it at the moment, either. I think that the
ResultObjectFactoryTest unit test does what you want. Take a look, andsee - if it is, please feel free to add a page to the WIKI(http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home
 )on how to use it.LarryOn 9/18/06, [EMAIL PROTECTED]  [EMAIL PROTECTED] wrote:
 Hi there! I vaguely remember reading that parameterised constructors were being considered for Ibatis. Is this still planned for a future release, or has the idea been dropped?
 I noticed that there was no mention of them in the documentation for the latest beta, which is a bit of a shame (for me anyway; not sure how many others would find them useful)
 ** This email is confidential and may contain

RE: Parameterised constructors

2006-09-20 Thread MCCORMICK, Paul



How do private setters work?
Could I set the 'foo' property using the result map below? Is there
anything I have to do to the jmv to allow it access to the private
field?

resultMap
class="Foo"
 result
property="foo" column="FOOBA"
/resultMap

public class Foo {

  private String
  foo;
  
  public String getFoo()
  {
   return
  foo;
  }
}

Thanks,
Paul



From: Clinton Begin
[mailto:[EMAIL PROTECTED] Sent: Tuesday, 19 September 2006
3:23 AMTo: user-java@ibatis.apache.orgSubject: Re:
Parameterised constructors
As a temporary alternative we do support private setters as of
2.2.0. Constructor injection is supported in the .NET
version. The two codebases are somewhat similar, so we could always check
on their approach to it. Clinton
On 9/18/06, Jeff
Butler [EMAIL PROTECTED] wrote:

  
  I remember some folks asking about this, but no commitment to do
  it. It would require quite a change to the way iBATIS processes result
  sets. Translation: don't expect this anytime soon.
  
  BTW, the Sun patterns web site has some information about an immutable
  transfer object pattern here:
  
  http://java.sun.com/blueprints/patterns/TransferObject.html
  
  The basic idea is that you create an interface for the immutable part,
  and a mutable static inner class for initializing. This does work with
  iBATIS. But one warning - we used this pattern on my team for a while
  and everyone (me included) HATED it. So we eventually went to simple
  JavaBeans with getters AND setters. 
  
  Jeff Butler
  
  
  On 9/18/06, [EMAIL PROTECTED]  [EMAIL PROTECTED]  wrote: 
  
  Mmm
... no that's not quite it.I have a set of VO classes that are
immutable. This means that all the data is added at
construction.|-+---|
| "Larry
Meadors" ||
|
[EMAIL PROTECTED]||
|
.org |
|
| Sent
by:||
|
[EMAIL PROTECTED]||
| ail.com
 |
|
|
||
|
| |
| 18/09/2006
13:10||
| Please
respond||
| to
user-java||
|
|
|-+--||
|
|To:user-java@ibatis.apache.org
|
|cc:(bcc:
Ray
Offiah/WRSYS/MANSERV/JLP)
| |Subject: Re:
Parameterised
constructors|
---|
  
  I am not
  finding docs for it at the moment, either. I think that the
  ResultObjectFactoryTest unit test does what you want. Take a look, and
  see - if it is, please feel free to add a page to the WIKI (http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home
  )on how to use it.LarryOn 9/18/06, [EMAIL PROTECTED] 
  [EMAIL PROTECTED] wrote: Hi
  there! I vaguely remember reading that parameterised
  constructors were being  considered for Ibatis. Is this still planned
  for a future release, or has  the idea been dropped? I
  noticed that there was no mention of them in the documentation for the
  latest beta, which is a bit of a shame (for me anyway; not sure how many
   others would find them useful) 
  **
  This email is confidential and may contain copyright material of the John
  Lewis Partnership. If you are not the intended recipient, please notify us
  immediately and delete all copies of this message. (Please note that it
  isyour responsibility to scan this message for viruses). Email to and from
  the John Lewis Partnership is automatically monitored for operational and
  lawful business reasons.
  **
  John Lewis plc Registered in England 233462  Registered
  office171 Victoria Street London SW1E 5NN 
  Websites: http://www.johnlewis.com http://www.waitrose.com
   http://www.johnlewispartnership.co.uk
  **
  **This
  email is confidential and may contain copyright material of the John Lewis
  Partnership. If you are not the intended recipient, please notify us
  immediately and delete all copies of this message. (Please note that it is
  your responsibility to scan this message for viruses). Email to and from the
  John Lewis Partnership is automatically monitored for operational and lawful
  business reasons.
  **John
  Lewis plcRegistered in England 233462Registered office171
  Victoria Street London SW1E 5NNWebsites: http://www.johnlewis.comhttp://www.waitrose.comhttp://www.johnlewispartnership.co.uk**
  
  

Re: Parameterised constructors

2006-09-19 Thread Ray_Offiah
The private setters is a nice addition, but not really helpful in our
situation because the fields actually don't have setters at all; the object
is filled in through the constructor call.

I did pick up on some interesting conversations that you had with the the
guy who wrote O/R Broker, which seems to have a nice pattern for dealing
with constructors and complex loading statements (like loading up a field
based on the contents of another field). Hopefully we'll see something
similar in IBatis in the future.

Thanks for your help ... :-)



|-+---
| |   Clinton Begin |
| |   [EMAIL PROTECTED]|
| |   mail.com   |
| |   |
| |   18/09/2006 20:22|
| |   Please respond  |
| |   to user-java|
| |   |
|-+---
  
---|
  | 
  |
  |To:  user-java@ibatis.apache.org 
  |
  |cc:  (bcc: Ray Offiah/WRSYS/MANSERV/JLP) 
  |
  |Subject: Re: Parameterised constructors  
  |
  
---|




As a temporary alternative we do support private setters as of 2.2.0.

Constructor injection is supported in the .NET version.  The two codebases
are somewhat similar, so we could always check on their approach to it.

Clinton

On 9/18/06, Jeff Butler [EMAIL PROTECTED] wrote:
I remember some folks asking about this, but no commitment to do it.  It
would require quite a change to the way iBATIS processes result sets.
Translation: don't expect this anytime soon.

BTW, the Sun patterns web site has some information about an immutable
transfer object pattern here:

http://java.sun.com/blueprints/patterns/TransferObject.html

The basic idea is that you create an interface for the immutable part, and
a mutable static inner class for initializing.  This does work with iBATIS.
But one warning - we used this pattern on my team for a while and everyone
(me included) HATED it.  So we eventually went to simple JavaBeans with
getters AND setters.

Jeff Butler


On 9/18/06, [EMAIL PROTECTED]  [EMAIL PROTECTED]  wrote:
Mmm ... no that's not quite it.

I have a set of VO classes that are immutable. This means that all the data

is added at construction.



|-+---
| |   Larry Meadors |
| |   [EMAIL PROTECTED]|
| |   .org   |
| |   Sent by:|
| |   [EMAIL PROTECTED]|
| |   ail.com  |
| |   |
| |   |
| |   18/09/2006 13:10|
| |   Please respond  |
| |   to user-java|
| |   |
|-+---
---|

|
|
|To:  user-java@ibatis.apache.org
|
|cc:  (bcc: Ray Offiah/WRSYS/MANSERV/JLP)
|
|Subject: Re: Parameterised constructors
|
---|






I am not finding docs for it at the moment, either. I think that the
ResultObjectFactoryTest unit test does what you want. Take a look, and
see - if it is, please feel free to add a page to the WIKI
(http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home )
on how to use it.

Larry


On 9/18/06, [EMAIL PROTECTED]  [EMAIL PROTECTED] wrote:

 Hi there!

 I vaguely remember reading that parameterised constructors were being
 considered for Ibatis. Is this still planned for a future release, or has

 the idea been dropped?

 I noticed that there was no mention of them in the documentation for the
 latest beta, which is a bit of a shame (for me anyway; not sure how many
 others would find them useful)



 **
 This email is confidential and may contain copyright material of the John

Lewis Partnership. If you are not the intended recipient, please notify us
immediately and delete all copies of this message. (Please note that it is
your responsibility to scan this message for viruses). Email to and from
the John Lewis Partnership is automatically monitored for operational and
lawful business reasons

Re: Parameterised constructors

2006-09-19 Thread Clinton Begin
I understand that you're using constructor injection and that they don't have setters.What I'm suggesting is that you add private setters and a parameterless constructor. It won't have any impact on the immutability of your class. 
It's a bit of extra code, but not uncommon. I know it's not ideal, but it would work for the time being.Cheers,ClintonOn 9/19/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
The private setters is a nice addition, but not really helpful in oursituation because the fields actually don't have setters at all; the objectis filled in through the constructor call.I did pick up on some interesting conversations that you had with the the
guy who wrote O/R Broker, which seems to have a nice pattern for dealingwith constructors and complex loading statements (like loading up a fieldbased on the contents of another field). Hopefully we'll see something
similar in IBatis in the future.Thanks for your help ... :-)|-+---| | Clinton Begin || | [EMAIL PROTECTED]
|| | mail.com || | || | 18/09/2006 20:22|| | Please respond|| | to user-java|
| | ||-+--|| |
|To:user-java@ibatis.apache.org ||cc:(bcc: Ray Offiah/WRSYS/MANSERV/JLP) |
|Subject: Re: Parameterised constructors|---|
As a temporary alternative we do support private setters as of 2.2.0.Constructor injection is supported in the .NET version.The two codebasesare somewhat similar, so we could always check on their approach to it.
ClintonOn 9/18/06, Jeff Butler [EMAIL PROTECTED] wrote:I remember some folks asking about this, but no commitment to do it.Itwould require quite a change to the way iBATIS processes result sets.
Translation: don't expect this anytime soon.BTW, the Sun patterns web site has some information about an immutabletransfer object pattern here:
http://java.sun.com/blueprints/patterns/TransferObject.htmlThe basic idea is that you create an interface for the immutable part, anda mutable static inner class for initializing.This does work with iBATIS.
But one warning - we used this pattern on my team for a while and everyone(me included) HATED it.So we eventually went to simple JavaBeans withgetters AND setters.Jeff ButlerOn 9/18/06, 
[EMAIL PROTECTED]  [EMAIL PROTECTED]  wrote:Mmm ... no that's not quite it.I have a set of VO classes that are immutable. This means that all the data
is added at construction.|-+---| | Larry Meadors || | [EMAIL PROTECTED]|| | .org |
| | Sent by:|| | [EMAIL PROTECTED]|| | ail.com|| | || | |
| | 18/09/2006 13:10|| | Please respond|| | to user-java|| | ||-+---
---To:user-java@ibatis.apache.org
||cc:(bcc: Ray Offiah/WRSYS/MANSERV/JLP)||Subject: Re: Parameterised constructors|---|
I am not finding docs for it at the moment, either. I think that theResultObjectFactoryTest unit test does what you want. Take a look, andsee - if it is, please feel free to add a page to the WIKI
(http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home )on how to use it.LarryOn 9/18/06, 
[EMAIL PROTECTED]  [EMAIL PROTECTED] wrote: Hi there! I vaguely remember reading that parameterised constructors were being
 considered for Ibatis. Is this still planned for a future release, or has the idea been dropped? I noticed that there was no mention of them in the documentation for the latest beta, which is a bit of a shame (for me anyway; not sure how many
 others would find them useful) ** This email is confidential and may contain copyright material of the John
Lewis Partnership. If you are not the intended recipient, please notify usimmediately and delete all copies of this message. (Please note that it isyour responsibility to scan this message for viruses). Email to and from
the John Lewis Partnership is automatically monitored for operational andlawful business reasons. ** John Lewis plc Registered in England 233462
 Registered office171 Victoria Street London SW1E 5NN Websites: http://www.johnlewis.com http://www.waitrose.com
 http://www.johnlewispartnership.co.uk **
**This email is confidential and may contain copyright material of the JohnLewis Partnership. If you are not the intended recipient, please notify us
immediately and delete all copies of this message. (Please note that it isyour

Re: Parameterised constructors

2006-09-19 Thread Ray_Offiah
It'll raise a few eyebrows but I'll see what the chaps say.

Is there any documentation anywhere on using private setters? Do I need to
add something to the result map entries, and will I need to fiddle with the
JVM security manager?



|-+---
| |   Clinton Begin |
| |   [EMAIL PROTECTED]|
| |   mail.com   |
| |   |
| |   19/09/2006 15:11|
| |   Please respond  |
| |   to user-java|
| |   |
|-+---
  
---|
  | 
  |
  |To:  user-java@ibatis.apache.org 
  |
  |cc:  (bcc: Ray Offiah/WRSYS/MANSERV/JLP) 
  |
  |Subject: Re: Parameterised constructors  
  |
  
---|





I understand that you're using constructor injection and that they don't
have setters.

What I'm suggesting is that you add private setters and a parameterless
constructor.  It won't have any impact on the immutability of your class.

It's a bit of extra code, but not uncommon.  I know it's not ideal, but it
would work for the time being.

Cheers,
Clinton


On 9/19/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
The private setters is a nice addition, but not really helpful in our
situation because the fields actually don't have setters at all; the object
is filled in through the constructor call.

I did pick up on some interesting conversations that you had with the the
guy who wrote O/R Broker, which seems to have a nice pattern for dealing
with constructors and complex loading statements (like loading up a field
based on the contents of another field). Hopefully we'll see something
similar in IBatis in the future.

Thanks for your help ... :-)



|-+---
| |   Clinton Begin |
| |   [EMAIL PROTECTED] |
| |   mail.com   |
| |   |
| |   18/09/2006 20:22|
| |   Please respond  |
| |   to user-java|
| |   |
|-+---

---|

  |
|
  |To:  user-java@ibatis.apache.org
|
  |cc:  (bcc: Ray Offiah/WRSYS/MANSERV/JLP)
|
  |Subject: Re: Parameterised constructors
|

---|





As a temporary alternative we do support private setters as of 2.2.0.

Constructor injection is supported in the .NET version.  The two codebases
are somewhat similar, so we could always check on their approach to it.

Clinton

On 9/18/06, Jeff Butler [EMAIL PROTECTED] wrote:
I remember some folks asking about this, but no commitment to do it.  It
would require quite a change to the way iBATIS processes result sets.
Translation: don't expect this anytime soon.

BTW, the Sun patterns web site has some information about an immutable
transfer object pattern here:

http://java.sun.com/blueprints/patterns/TransferObject.html

The basic idea is that you create an interface for the immutable part, and
a mutable static inner class for initializing.  This does work with iBATIS.

But one warning - we used this pattern on my team for a while and everyone
(me included) HATED it.  So we eventually went to simple JavaBeans with
getters AND setters.

Jeff Butler


On 9/18/06, [EMAIL PROTECTED]  [EMAIL PROTECTED]  wrote:
Mmm ... no that's not quite it.

I have a set of VO classes that are immutable. This means that all the data


is added at construction.



|-+---
| |   Larry Meadors |
| |   [EMAIL PROTECTED]|
| |   .org   |
| |   Sent by:|
| |   [EMAIL PROTECTED]|
| |   ail.com  |
| |   |
| |   |
| |   18/09/2006 13:10|
| |   Please respond  |
| |   to user-java|
| |   |
|-+---
---|


|
|
|To:  user-java@ibatis.apache.org
|
|cc

Re: Parameterised constructors

2006-09-18 Thread Larry Meadors

I am not finding docs for it at the moment, either. I think that the
ResultObjectFactoryTest unit test does what you want. Take a look, and
see - if it is, please feel free to add a page to the WIKI
(http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home)
on how to use it.

Larry


On 9/18/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


Hi there!

I vaguely remember reading that parameterised constructors were being
considered for Ibatis. Is this still planned for a future release, or has
the idea been dropped?

I noticed that there was no mention of them in the documentation for the
latest beta, which is a bit of a shame (for me anyway; not sure how many
others would find them useful)



**
This email is confidential and may contain copyright material of the John Lewis 
Partnership. If you are not the intended recipient, please notify us 
immediately and delete all copies of this message. (Please note that it is your 
responsibility to scan this message for viruses). Email to and from the John 
Lewis Partnership is automatically monitored for operational and lawful 
business reasons.
**
John Lewis plc
Registered in England 233462
Registered office  171 Victoria Street London SW1E 5NN

Websites: http://www.johnlewis.com
http://www.waitrose.com
http://www.johnlewispartnership.co.uk

**




Re: Parameterised constructors

2006-09-18 Thread Ray_Offiah
Mmm ... no that's not quite it.

I have a set of VO classes that are immutable. This means that all the data
is added at construction.



|-+---
| |   Larry Meadors |
| |   [EMAIL PROTECTED]|
| |   .org   |
| |   Sent by:|
| |   [EMAIL PROTECTED]|
| |   ail.com |
| |   |
| |   |
| |   18/09/2006 13:10|
| |   Please respond  |
| |   to user-java|
| |   |
|-+---
  
---|
  | 
  |
  |To:  user-java@ibatis.apache.org 
  |
  |cc:  (bcc: Ray Offiah/WRSYS/MANSERV/JLP) 
  |
  |Subject: Re: Parameterised constructors  
  |
  
---|




I am not finding docs for it at the moment, either. I think that the
ResultObjectFactoryTest unit test does what you want. Take a look, and
see - if it is, please feel free to add a page to the WIKI
(http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home)
on how to use it.

Larry


On 9/18/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hi there!

 I vaguely remember reading that parameterised constructors were being
 considered for Ibatis. Is this still planned for a future release, or has
 the idea been dropped?

 I noticed that there was no mention of them in the documentation for the
 latest beta, which is a bit of a shame (for me anyway; not sure how many
 others would find them useful)



 **
 This email is confidential and may contain copyright material of the John
Lewis Partnership. If you are not the intended recipient, please notify us
immediately and delete all copies of this message. (Please note that it is
your responsibility to scan this message for viruses). Email to and from
the John Lewis Partnership is automatically monitored for operational and
lawful business reasons.
 **
 John Lewis plc
 Registered in England 233462
 Registered office  171 Victoria Street London SW1E 5NN

 Websites: http://www.johnlewis.com
 http://www.waitrose.com
 http://www.johnlewispartnership.co.uk

 **






**
This email is confidential and may contain copyright material of the John Lewis 
Partnership. If you are not the intended recipient, please notify us 
immediately and delete all copies of this message. (Please note that it is your 
responsibility to scan this message for viruses). Email to and from the John 
Lewis Partnership is automatically monitored for operational and lawful 
business reasons.
**
John Lewis plc
Registered in England 233462
Registered office  171 Victoria Street London SW1E 5NN

Websites: http://www.johnlewis.com 
http://www.waitrose.com
http://www.johnlewispartnership.co.uk

**



Re: Parameterised constructors

2006-09-18 Thread Jeff Butler
I remember some folks asking about this, but no commitment to do it. It would require quite a change to the way iBATIS processes result sets. Translation: don't expect this anytime soon.

BTW, the Sun patterns web site has some information about an immutable transfer object pattern here:

http://java.sun.com/blueprints/patterns/TransferObject.html

The basic idea is that you create an interface for the immutable part, and a mutable static inner class for initializing. This does work with iBATIS. But one warning - we used this pattern on my team for a while and everyone (me included) HATED it. So we eventually went to simple JavaBeans with getters AND setters.


Jeff Butler

On 9/18/06, [EMAIL PROTECTED] 
[EMAIL PROTECTED]  wrote: 
Mmm ... no that's not quite it.I have a set of VO classes that are immutable. This means that all the data 
is added at construction.|-+---| | Larry Meadors || | [EMAIL PROTECTED]|| | .org | 
| | Sent by:|| | [EMAIL PROTECTED]|| | ail.com |
| | || | | | | 18/09/2006 13:10|| | Please respond|| | to user-java|| | |
|-+--|| | 
|To:user-java@ibatis.apache.org |
|cc:(bcc: Ray Offiah/WRSYS/MANSERV/JLP) | |Subject: Re: Parameterised constructors|
---| I am not finding docs for it at the moment, either. I think that theResultObjectFactoryTest unit test does what you want. Take a look, and
see - if it is, please feel free to add a page to the WIKI (http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home
)on how to use it.LarryOn 9/18/06, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote: Hi there! I vaguely remember reading that parameterised constructors were being  considered for Ibatis. Is this still planned for a future release, or has
 the idea been dropped? I noticed that there was no mention of them in the documentation for the latest beta, which is a bit of a shame (for me anyway; not sure how many  others would find them useful)
 ** This email is confidential and may contain copyright material of the John Lewis Partnership. If you are not the intended recipient, please notify us
immediately and delete all copies of this message. (Please note that it isyour responsibility to scan this message for viruses). Email to and from the John Lewis Partnership is automatically monitored for operational and
lawful business reasons. ** John Lewis plc Registered in England 233462  Registered office171 Victoria Street London SW1E 5NN
 Websites: http://www.johnlewis.com 
http://www.waitrose.com  http://www.johnlewispartnership.co.uk **
**This email is confidential and may contain copyright material of the John Lewis Partnership. If you are not the intended recipient, please notify us immediately and delete all copies of this message. (Please note that it is your responsibility to scan this message for viruses). Email to and from the John Lewis Partnership is automatically monitored for operational and lawful business reasons. 
**John Lewis plcRegistered in England 233462Registered office171 Victoria Street London SW1E 5NNWebsites: 
http://www.johnlewis.comhttp://www.waitrose.com
http://www.johnlewispartnership.co.uk** 


Re: Parameterised constructors

2006-09-18 Thread Clinton Begin
As a temporary alternative we do support private setters as of 2.2.0. Constructor injection is supported in the .NET version. The two codebases are somewhat similar, so we could always check on their approach to it.
ClintonOn 9/18/06, Jeff Butler [EMAIL PROTECTED] wrote:
I remember some folks asking about this, but no commitment to do it. It would require quite a change to the way iBATIS processes result sets. Translation: don't expect this anytime soon.

BTW, the Sun patterns web site has some information about an immutable transfer object pattern here:

http://java.sun.com/blueprints/patterns/TransferObject.html

The basic idea is that you create an interface for the immutable part, and a mutable static inner class for initializing. This does work with iBATIS. But one warning - we used this pattern on my team for a while and everyone (me included) HATED it. So we eventually went to simple JavaBeans with getters AND setters.


Jeff Butler

On 9/18/06, [EMAIL PROTECTED]
 
[EMAIL PROTECTED]  wrote: 
Mmm ... no that's not quite it.I have a set of VO classes that are immutable. This means that all the data 
is added at construction.|-+---| | Larry Meadors || | [EMAIL PROTECTED]|| | .org | 
| | Sent by:|| | [EMAIL PROTECTED]|| | ail.com
 |
| | || | | | | 18/09/2006 13:10|| | Please respond|| | to user-java|
| | |
|-+--|| | 
|To:user-java@ibatis.apache.org |
|cc:(bcc: Ray Offiah/WRSYS/MANSERV/JLP) | |Subject: Re: Parameterised constructors|
---| I am not finding docs for it at the moment, either. I think that the
ResultObjectFactoryTest unit test does what you want. Take a look, and
see - if it is, please feel free to add a page to the WIKI (http://opensource.atlassian.com/confluence/oss/display/IBATIS/Home
)on how to use it.LarryOn 9/18/06, [EMAIL PROTECTED] 

[EMAIL PROTECTED] wrote: Hi there! I vaguely remember reading that parameterised constructors were being  considered for Ibatis. Is this still planned for a future release, or has
 the idea been dropped? I noticed that there was no mention of them in the documentation for the latest beta, which is a bit of a shame (for me anyway; not sure how many  others would find them useful)
 ** This email is confidential and may contain copyright material of the John Lewis Partnership. If you are not the intended recipient, please notify us
immediately and delete all copies of this message. (Please note that it isyour responsibility to scan this message for viruses). Email to and from the John Lewis Partnership is automatically monitored for operational and
lawful business reasons. ** John Lewis plc Registered in England 233462  Registered office171 Victoria Street London SW1E 5NN
 Websites: http://www.johnlewis.com 

http://www.waitrose.com  http://www.johnlewispartnership.co.uk **
**This email is confidential and may contain copyright material of the John Lewis Partnership. If you are not the intended recipient, please notify us immediately and delete all copies of this message. (Please note that it is your responsibility to scan this message for viruses). Email to and from the John Lewis Partnership is automatically monitored for operational and lawful business reasons. 
**John Lewis plcRegistered in England 233462Registered office171 Victoria Street London SW1E 5NNWebsites: 

http://www.johnlewis.comhttp://www.waitrose.com

http://www.johnlewispartnership.co.uk**