Abator vs. iBATIS....Brandon and Larry were right....doh.

2006-07-12 Thread Clinton Begin
Okay...so today I got my first personal email from a very confused user:---Dear sir,
         i'm new to ibatis.thru
abator i generated files such as,2 dao classes,3 java classes and 1 sql
map file for each table.inorder to retrieve data from a table
anddisplay vat i have to do.i'm nt getting any idea by seeing
JpetStore.that is different from the files created by abator 4 me.  ---Okay, so there's a clear language issue.  But beyond that, this person does not understand that Abator is NOT iBATIS (and vice versa).  
Jeff:  Can you suggest a way to clarify that Abator and similar tools are not required, nor are they a "part" of iBATIS?Tools are very valuable, but we must ensure that iBATIS remains independent and that everyone understands the boundaries.
Cheers,Clinton


RE: interface property predicaments

2006-07-12 Thread Poitras Christian
Your Article class does not respect java beans specification.

  public void setPerson(Person person) {
this.person = person;
  }
  // required for ibatis object construction
  public void setPerson(PersonImpl person) {
this.person = person;
  }
 
Having to setters with different argument produces an invalid bean and
java cannot find the setter.

In your case, you should have a second setter like this (only if the
first one doesn't work).
  // required for ibatis object construction
  public void setPersonImpl(PersonImpl person) {
this.person = person;
  }
Then, update your sqlmap files.

Chris

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Larry Meadors
Sent: Tuesday, 11 July 2006 13:26
To: Paul Benedict
Cc: user-java@ibatis.apache.org
Subject: Re: interface property predicaments

Why does iBATIS need to know anything about the interface?

Larry


On 7/11/06, Paul Benedict <[EMAIL PROTECTED]> wrote:
> Larry, I am implementing an API. So this is the problem I have to deal

> with :-(
>
> The other guy is right. Ibatis thinks there is no setId on the Person 
> because Person interface is read-only, although in the sqlmap I am 
> constructing a PersonImpl on an ArticleImpl.
>
> I believe ibatis can be changed to solve this problem: Assuming that 
> ibatis constructs inner objects as it navigates (does it?), it should 
> use the instance it creates rather than looking at the type from the
getter.
>
> Otherwise I will have to have a diferent getter on my object just for 
> ibatis that returns the impl.
>
> Paul
>
>
> Larry Meadors <[EMAIL PROTECTED]> wrote:
>
>  So...I do not understand..your beans are interfaces?
>
> How often do you swap out the implementation of your beans? ;-)
>
> Larry
>
>
> On 7/10/06, Paul Benedict wrote:
> > I have two interfaces: Article and Person. My problem is with my 
> > Article
> > implementation:
> >
> > public interface Article {
> > public Person getPerson();
> > }
> >
> > public class ArticleImpl extends Article { private Person person; 
> > public Person getPerson() { return person; } public void 
> > setPerson(Person person) { this.person = person; } // required for 
> > ibatis object construction public void setPerson(PersonImpl person) 
> > { this.person = person; } }
> >
> > I am using ibatis to construct it as follows:
> >
> >
> >
> >
> >
> > I get that annoying "cannot find WRITABLE property id in Person" 
> > message because it is looks at Article.getPerson() which returns the

> > interface not implementation. But why should that matter? This is 
> > wrong behavior, imo. I know ibatis constructs the inner object 
> > first. It will create a
> PersonImpl,
> > set property "id" from column "person_id", and then call the setter 
> > on Article.
> >
> > Otherwise, I am left believing ibatis cannot work with classes which

> > need
> to
> > implement a read-only interface. or someone can recommend the
> solution,
> > which I might be unable to find?
> >
> > Paul
> >
> >
> > 
> > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone 
> > call
> rates.
> >
> >
>
>
>
>
>  
> Do you Yahoo!?
>  Next-gen email? Have it all with the all-new Yahoo! Mail Beta.
>
>



Re: Isolation level support at the DAO framework level ...

2006-07-12 Thread Eric Tan
Hi JeffThanks for the reply.I had suspected that it would be hard to implement this for all the different frameworks.I like the idea of being able to demarcate transactions above the DAO level. For example, in the JPetStore example, within the OrderService.java, the transaction involves 2 DAOs.  public void insertOrder(Order order) {    try {  // Get the next id within a separate transaction  order.setOrderId(getNextId("ordernum"));  daoManager.startTransaction();  itemDao.updateAllQuantitiesFromOrder(order);  orderDao.insertOrder(order);  daoManager.commitTransaction();    } finally {  daoManager.endTransaction();    }  }For
 each DAO in the JPetStore, there is no need to demarcate transactions. It is done at the Service object level. This is both clean and simple and provides more reuse of DAO methods when a new service is required and must work within its own transaction. I had used iBatis for a project back in 2003 and I love it for its simplicity. Back then I was using only the SQL Map. This time round, I decided to try out the DAO framework, together with SQL Map. I anticipated the need to set isolation level for certain requirements, hence the JIRA ticket and this thread.I think this request will only complicate things, so I guess I will fall back to using SQL Map with transaction demarcation shifted to within the DAO classes.For example,class MyDAO {    public void insertOrder(...) {   
 sqlMap.startTransaction(Connection.TRANSACTION_SERIALIZABLE);    sqlMap.update("Item.updateInventoryQuatity", ...);    sqlMap.insert("Order.insertOrder", ...)'    sqlMap.commitTransaction();    .    .    }}Thanks,EricJeff Butler <[EMAIL PROTECTED]> wrote: I don't know why it wasn't done in the 2.0.9 time frame, but I've been looking at it due to your JIRA ticket.  The truth is that this isn't that easy to do.  The DAO framework supports DAOs for iBATIS SqlMaps, Hibernate, Toplink, OJB, etc.  It is not so easy to set the isolation level programmatically in all of these
 implementations.  Most of the implementations have other ways to set this - typically in some configuration setting.    If we add a method to the DaoManager interface to set isolation level, someone would have to figure out how to do it programmatically in all the other frameworks - either that or throw a bunch of UnsupportedOperationExceptions.    If you could describe what you're trying to achieve then maybe we could help you find a way to do it.   Jeff Butler   On 7/10/06, Eric Tan <[EMAIL PROTECTED]> wrote:  HiSince 2.0.9, the SQL Maps framework has the ability to specify isolation
 level per transaction, eg: sqlMap.startTransaction(Connection.TRANSACTION_REPEATABLE_READ); However, using the DAO framework, there is still no way to specify an isolation level using  DaoManager.startTransaction(). Just wondering, were there any previous considerations why isolation level support wasn't added to the DaoManager back in 2.0.9? Thanks  The World Cup Is Now On Your Favorite Front Page - check out  www.yahoo.com.sg
		  
Real people. Real questions. Real answers. Share what you know.

Re: Multiple ResultSet

2006-07-12 Thread Clinton Begin
Not yet, but I'm supposed to be working on that right now.  Unfortunately I've been swamped.It should be going out with the next release (2.2.0) -- is anyone interested in taking this over?  The earliest I think I'll get to it is next week.
Cheers,ClintonOn 7/12/06, Cornel Antohi <[EMAIL PROTECTED]> wrote:







Hi,
 
Does iBatis support multiple ResultSet returned by 
a StoredProcedure?
 
Thank you,
Cornel




Re: iBATS & CGLIB

2006-07-12 Thread Clinton Begin
Wow.On 7/11/06, Pradheep <[EMAIL PROTECTED]> wrote:







Clinton
 
Thanks for your suggestion and now tried using 
Batch Process.
5000 records and its 2696 msecs.
 
Regards
Pradheep

  - Original Message - 
  
From: 
  Clinton 
  Begin 
  To: 
user-java@ibatis.apache.org 
  
  Sent: Wednesday, July 12, 2006 10:28 
  AM
  Subject: Re: iBATS & CGLIB

  Can you explain the timings?  Certainly it didn't take 
  31 hours to insert the records! I understand that in some countries the comma 
  (",") is used where I would use a decimal (".").  So if my understanding 
  is correct: 
  
We're talking 111 seconds for 5000 records, which is an about 0.0222 
seconds -- pretty darn fast. 
Furthermore, it looks like it's scaling linearly, which is a good thing.
I don't think CGLIB will help you. 
Ensuring that you're managing transactions efficiently is key (although 
5000+ records may be too big for many transaction logs).
Batch updates will probably help you.Here's a related 
  post:http://www.mail-archive.com/user-java@ibatis.apache.org/msg04760.html
Cheers,Clinton
  On 7/11/06, Pradheep <[EMAIL PROTECTED]
> 
  wrote:
  


Dear
 
i am inserting some 5000 records and the 
table has only 2 columns with the id and name where id is autoincremented 
and name is also added with the auto number [say pradheep+i]
i just checked a sample of 5000 records and 
the time it took vaires accordingly
Inserting 5000 records 111,765 
secsInserting 5000 records 111,750SecInserting 5000 
records 109,766SecInserting 1 records 201,812 secs
 
so when compared, its t slow. how do i 
improve my performance. can you suggest me on how to use this.
 
or else
 
when reading the document of SQL Map, they 
were talking about CGLIB. so i have downloaded that and added to my project. 

how do i work with CGLIB if 
needed.
 
URGENT...
 
Regards


  
  
 P R A D H E E P
A P P L I E D    D E V E L O P M E N 
  T 
  
  
Team 
  LeaderChennai, Indiae: [EMAIL PROTECTED] l: 
  00 91 44 39125333m: 00 91 94862 08089 





Multiple ResultSet

2006-07-12 Thread Cornel Antohi



Hi,
 
Does iBatis support multiple ResultSet returned by 
a StoredProcedure?
 
Thank you,
Cornel


batch update using SqlMapClientDaoSupport from Spring

2006-07-12 Thread Dodo



Hi, Just wandering has anyone done batch updating using    org.springframework.orm.ibatis.support.SqlMapClientDaoSupportusing the Spring framework??I am interested to use Spring to define transactions for methods invoked via SqlMapClientDaoSupport as below    txProxyTemplate" abstract="true"    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">                PROPAGATION_REQUIRED    PROPAGATION_REQUIRED    PROPAGATION_REQUIRED,readOnly            Can batch update be done like this and have same performance boost as manul batch update or do I have to result to manul batch update as inhttp://www.mail-archive.com/user-java@ibatis.apache.org/msg04760.html to achieve that performance? Thanks, Sam 


RE: RE : RE : RE : RE : request using beanExample

2006-07-12 Thread Yusuf
i had this kind of problem and solved using right padding with empty
space, eg.

Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, ETAT_MODIFIE,TSTMPINSR,
TSTMPUPDT  from UTILISATEUR where MOBILE = rpad(#value#,12,' ')

Regards,
Yusuf

-Original Message-
From: jeremy jardin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 12, 2006 4:13 PM
To: user-java@ibatis.apache.org; [EMAIL PROTECTED]
Subject: RE : RE : RE : RE : request using beanExample


I'm still having that pb.. even if I only insert 12CHAR long Strings !!

I insert my user with un phone Number like that "0600  "
(12 chars)

and in my request, I set my example witth thaht number : "0600
"

stil no results !! :-(



-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part
de Larry Meadors
Envoyé : mercredi 12 juillet 2006 10:49
À : user-java@ibatis.apache.org
Objet : Re: RE : RE : RE : request using beanExample

Yep.

On 7/11/06, jeremy jardin <[EMAIL PROTECTED]>
wrote:
> You mean that is my fiel dis CHAR(12)... and the string I put in is
only 8 char long;. It could be problematic ?
>
>
>
> -Message d'origine-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 10:37
> À: user-java@ibatis.apache.org
> Objet: Re: RE : RE : request using beanExample
>
> The length is probably wrong, and in all SQL dialects I have ever
> used, "  A"  does not equal "A".
>
> Larry
>
>
> On 7/11/06, jeremy jardin <[EMAIL PROTECTED]>
wrote:
> > A CHAR !!
> > Why ??
> >
> >
> > -Message d'origine-
> > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de Larry Meadors
> > Envoyé: mercredi 12 juillet 2006 09:50
> > À: user-java@ibatis.apache.org
> > Objet: Re: RE : request using beanExample
> >
> > Is MOBILE a CHAR field or VARCHAR?
> >
> > Larry
> >
> >
> > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]>
wrote:
> > > All my classes have been generated using Abator so, I have
something like that :
> > >
> > > List list =
sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample",
parms);
> > >
> > > Parms contains my where clause, instanciated the good way...
> > >
> > > PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN,
ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> > > Parameters: [0613410836]
> > > Types: [java.lang.String]
> > > ResultSet
> > >
> > >
> > > What's the matter with my request ?
> > >
> > >
> > > -Message d'origine-
> > > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de Larry Meadors
> > > Envoyé: mercredi 12 juillet 2006 09:39
> > > À: user-java@ibatis.apache.org
> > > Objet: Re: request using beanExample
> > >
> > > Do you have a resultMap or resultClass for the select?
> > >
> > > Larry
> > >
> > >
> > > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]>
wrote:
> > > >
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > >
> > > >
> > > > I'm trying to launch a request using a beanExample .. I've
logged the sql
> > > > request, and I can see that this request should answers 1
result.
> > > >
> > > >
> > > >
> > > > After all. my resultList is empty, and I don't know why.
> > > >
> > > >
> > > >
> > > > Any idea ?
> > > >
> > > >
> > >
> >
>




Re: Abator regeneration causes duplicated methods

2006-07-12 Thread Maarten Meijer
Hi Jeff,The duplicate methods are in ALL files, my table should map to a Cart family, so it generatesCart.java, CartDAO.java, CartDAOImpl.java, CartExample.java, and CartKey.javaWhen regenerating abator strips the comment, but not the field and methods, so the result looks like this for CartKey.java:public class CartKey {	private Integer cartID;	public Integer getCartID() {		return cartID;	}	public void setCartID(Integer cartID) {		this.cartID = cartID;	}	/**	 * This field was generated by Abator for iBATIS. This field corresponds to the database column lighting.lcart.c_cartID	 * @abatorgenerated  Tue Apr 11 15:43:19 CEST 2006	 */	private Integer cartID;	/**	 * This method was generated by Abator for iBATIS. This method returns the value of the database column lighting.lcart.c_cartID	 * @return  the value of lighting.lcart.c_cartID	 * @abatorgenerated  Tue Apr 11 15:43:19 CEST 2006	 */	public Integer getCartID() {		return cartID;	}	/**	 * This method was generated by Abator for iBATIS. This method sets the value of the database column lighting.lcart.c_cartID	 * @param cartID  the value for lighting.lcart.c_cartID	 * @abatorgenerated  Tue Apr 11 15:43:19 CEST 2006	 */	public void setCartID(Integer cartID) {		this.cartID = cartID;	}}Also note that a second  regeneration adds another group of uncommented(?) field and set/get methods. The comment with @abatorgenerated rertain the dat from the original generation. So the problem is twofold:1) the stuff previously generated is not recognized and deleted (some error in regular _expression_ maybe)2) the newly generated stuff doesn't include commentsThe files char-set is MacRoman (as is default on Eclipse Mac) and the line endings are UNIX (also default)If I can be of further assistance, please let me know!MaartenI've tested on Eclipse 3.2 (Windows) and I'm not seeing this behavior - a regeneration works fine for me.  So, here are some questions: 1. Are the duplicated methods in the DAOs, the model objects, or both? 2. Did the JavaDoc comments get stripped off the methods somehow before calling Abator?  Abator only knows what to delete by the @abatorgenerated JavaDoc element. I'm using Ababator 0.6.5 on Mac OSX with Eclipse 3.2. I've disabledOxygen to get back the 'Generate iBatis Artifacts' menu item again. I have decided to use the DAO as wll after all, so I added to theabatorConfig.xml:   targetProject="fold1wt">       I then do a 'Generate...' and OPPS, hundreds of errors, mostlyduplicate methods/fields. Reason: the old generated code is not removed, just stripped of thecomments!How can I get abator to generate correct code?Maarten 

RE : RE : RE : RE : request using beanExample

2006-07-12 Thread jeremy jardin
I'm still having that pb.. even if I only insert 12CHAR long Strings !!

I insert my user with un phone Number like that "0600  "
(12 chars)

and in my request, I set my example witth thaht number : "0600  "

stil no results !! :-(



-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé : mercredi 12 juillet 2006 10:49
À : user-java@ibatis.apache.org
Objet : Re: RE : RE : RE : request using beanExample

Yep.

On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> You mean that is my fiel dis CHAR(12)... and the string I put in is only 8 
> char long;. It could be problematic ?
>
>
>
> -Message d'origine-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 10:37
> À: user-java@ibatis.apache.org
> Objet: Re: RE : RE : request using beanExample
>
> The length is probably wrong, and in all SQL dialects I have ever
> used, "  A"  does not equal "A".
>
> Larry
>
>
> On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > A CHAR !!
> > Why ??
> >
> >
> > -Message d'origine-
> > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> > Envoyé: mercredi 12 juillet 2006 09:50
> > À: user-java@ibatis.apache.org
> > Objet: Re: RE : request using beanExample
> >
> > Is MOBILE a CHAR field or VARCHAR?
> >
> > Larry
> >
> >
> > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > > All my classes have been generated using Abator so, I have something like 
> > > that :
> > >
> > > List list = 
> > > sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", 
> > > parms);
> > >
> > > Parms contains my where clause, instanciated the good way...
> > >
> > > PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
> > > ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> > > Parameters: [0613410836]
> > > Types: [java.lang.String]
> > > ResultSet
> > >
> > >
> > > What's the matter with my request ?
> > >
> > >
> > > -Message d'origine-
> > > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry 
> > > Meadors
> > > Envoyé: mercredi 12 juillet 2006 09:39
> > > À: user-java@ibatis.apache.org
> > > Objet: Re: request using beanExample
> > >
> > > Do you have a resultMap or resultClass for the select?
> > >
> > > Larry
> > >
> > >
> > > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > >
> > > >
> > > > I'm trying to launch a request using a beanExample .. I've logged the 
> > > > sql
> > > > request, and I can see that this request should answers 1 result.
> > > >
> > > >
> > > >
> > > > After all. my resultList is empty, and I don't know why.
> > > >
> > > >
> > > >
> > > > Any idea ?
> > > >
> > > >
> > >
> >
>


RE : RE : RE : RE : request using beanExample

2006-07-12 Thread jeremy jardin
Arg it's quite bad...

And if it was a varchar it would be better ?


-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé : mercredi 12 juillet 2006 10:49
À : user-java@ibatis.apache.org
Objet : Re: RE : RE : RE : request using beanExample

Yep.

On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> You mean that is my fiel dis CHAR(12)... and the string I put in is only 8 
> char long;. It could be problematic ?
>
>
>
> -Message d'origine-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 10:37
> À: user-java@ibatis.apache.org
> Objet: Re: RE : RE : request using beanExample
>
> The length is probably wrong, and in all SQL dialects I have ever
> used, "  A"  does not equal "A".
>
> Larry
>
>
> On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > A CHAR !!
> > Why ??
> >
> >
> > -Message d'origine-
> > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> > Envoyé: mercredi 12 juillet 2006 09:50
> > À: user-java@ibatis.apache.org
> > Objet: Re: RE : request using beanExample
> >
> > Is MOBILE a CHAR field or VARCHAR?
> >
> > Larry
> >
> >
> > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > > All my classes have been generated using Abator so, I have something like 
> > > that :
> > >
> > > List list = 
> > > sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", 
> > > parms);
> > >
> > > Parms contains my where clause, instanciated the good way...
> > >
> > > PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
> > > ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> > > Parameters: [0613410836]
> > > Types: [java.lang.String]
> > > ResultSet
> > >
> > >
> > > What's the matter with my request ?
> > >
> > >
> > > -Message d'origine-
> > > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry 
> > > Meadors
> > > Envoyé: mercredi 12 juillet 2006 09:39
> > > À: user-java@ibatis.apache.org
> > > Objet: Re: request using beanExample
> > >
> > > Do you have a resultMap or resultClass for the select?
> > >
> > > Larry
> > >
> > >
> > > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > >
> > > >
> > > > I'm trying to launch a request using a beanExample .. I've logged the 
> > > > sql
> > > > request, and I can see that this request should answers 1 result.
> > > >
> > > >
> > > >
> > > > After all. my resultList is empty, and I don't know why.
> > > >
> > > >
> > > >
> > > > Any idea ?
> > > >
> > > >
> > >
> >
>


Re: RE : RE : RE : request using beanExample

2006-07-12 Thread Larry Meadors

Yep.

On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:

You mean that is my fiel dis CHAR(12)... and the string I put in is only 8 char 
long;. It could be problematic ?



-Message d'origine-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé: mercredi 12 juillet 2006 10:37
À: user-java@ibatis.apache.org
Objet: Re: RE : RE : request using beanExample

The length is probably wrong, and in all SQL dialects I have ever
used, "  A"  does not equal "A".

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> A CHAR !!
> Why ??
>
>
> -Message d'origine-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 09:50
> À: user-java@ibatis.apache.org
> Objet: Re: RE : request using beanExample
>
> Is MOBILE a CHAR field or VARCHAR?
>
> Larry
>
>
> On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > All my classes have been generated using Abator so, I have something like 
that :
> >
> > List list = 
sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", parms);
> >
> > Parms contains my where clause, instanciated the good way...
> >
> > PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> > Parameters: [0613410836]
> > Types: [java.lang.String]
> > ResultSet
> >
> >
> > What's the matter with my request ?
> >
> >
> > -Message d'origine-
> > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> > Envoyé: mercredi 12 juillet 2006 09:39
> > À: user-java@ibatis.apache.org
> > Objet: Re: request using beanExample
> >
> > Do you have a resultMap or resultClass for the select?
> >
> > Larry
> >
> >
> > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > >
> > > Hello,
> > >
> > >
> > >
> > > I'm trying to launch a request using a beanExample .. I've logged the sql
> > > request, and I can see that this request should answers 1 result.
> > >
> > >
> > >
> > > After all. my resultList is empty, and I don't know why.
> > >
> > >
> > >
> > > Any idea ?
> > >
> > >
> >
>



RE : RE : RE : request using beanExample

2006-07-12 Thread jeremy jardin
You mean that is my fiel dis CHAR(12)... and the string I put in is only 8 char 
long;. It could be problematic ?



-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé : mercredi 12 juillet 2006 10:37
À : user-java@ibatis.apache.org
Objet : Re: RE : RE : request using beanExample

The length is probably wrong, and in all SQL dialects I have ever
used, "  A"  does not equal "A".

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> A CHAR !!
> Why ??
>
>
> -Message d'origine-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 09:50
> À: user-java@ibatis.apache.org
> Objet: Re: RE : request using beanExample
>
> Is MOBILE a CHAR field or VARCHAR?
>
> Larry
>
>
> On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > All my classes have been generated using Abator so, I have something like 
> > that :
> >
> > List list = 
> > sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", 
> > parms);
> >
> > Parms contains my where clause, instanciated the good way...
> >
> > PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
> > ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> > Parameters: [0613410836]
> > Types: [java.lang.String]
> > ResultSet
> >
> >
> > What's the matter with my request ?
> >
> >
> > -Message d'origine-
> > De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> > Envoyé: mercredi 12 juillet 2006 09:39
> > À: user-java@ibatis.apache.org
> > Objet: Re: request using beanExample
> >
> > Do you have a resultMap or resultClass for the select?
> >
> > Larry
> >
> >
> > On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > >
> > > Hello,
> > >
> > >
> > >
> > > I'm trying to launch a request using a beanExample .. I've logged the sql
> > > request, and I can see that this request should answers 1 result.
> > >
> > >
> > >
> > > After all. my resultList is empty, and I don't know why.
> > >
> > >
> > >
> > > Any idea ?
> > >
> > >
> >
>


Re: RE : RE : request using beanExample

2006-07-12 Thread Larry Meadors

The length is probably wrong, and in all SQL dialects I have ever
used, "  A"  does not equal "A".

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:

A CHAR !!
Why ??


-Message d'origine-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé: mercredi 12 juillet 2006 09:50
À: user-java@ibatis.apache.org
Objet: Re: RE : request using beanExample

Is MOBILE a CHAR field or VARCHAR?

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> All my classes have been generated using Abator so, I have something like 
that :
>
> List list = 
sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", parms);
>
> Parms contains my where clause, instanciated the good way...
>
> PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> Parameters: [0613410836]
> Types: [java.lang.String]
> ResultSet
>
>
> What's the matter with my request ?
>
>
> -Message d'origine-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 09:39
> À: user-java@ibatis.apache.org
> Objet: Re: request using beanExample
>
> Do you have a resultMap or resultClass for the select?
>
> Larry
>
>
> On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > Hello,
> >
> >
> >
> > I'm trying to launch a request using a beanExample .. I've logged the sql
> > request, and I can see that this request should answers 1 result.
> >
> >
> >
> > After all. my resultList is empty, and I don't know why.
> >
> >
> >
> > Any idea ?
> >
> >
>



Re: How to use a function on a parameter in an "update" mapped statement?

2006-07-12 Thread Larry Meadors

Nope, I think there is something else going on here...iBATIS is not
changing your SQL...so if it says "jobduedate=?" then that is what is
in the SQL map.

How are you building the application?

Larry


On 7/11/06, Fred Janon <[EMAIL PROTECTED]> wrote:

Hi Ted,

Thanks for the suggestion, I looked at the link you mentioned, but I
don't think that's the issue. It looks like iBatis doesn't even generatr
the correct statement if the log is correct:

PreparedStatement: update jobs  set clientid=?, summary=?,
jobduedate=?where jobid=?

In this statement, "jobduedate=?" should actually genarated as
"jobduedate=str_to_date(?, '%d/%m/%Y')" I think.

I hope someone gives me a pointer here, I have the suspicion that iBatis
just replaces the right hand side of the '=' by '?' and ignores the
actual RHS expression.

Fred

Ted Schrader wrote:
> Hi Fred,
>
> Does mySQL allow place holders inside of functions for JDBC?  For
> example:
>
> update jobs
> set clientid=?, summary=?, jobduedate=str_to_date(?)
> where jobid=?
>
> I ran into a similar problem with DB2 on the AS400/iSeries/i5.  Check
> out the last entry on
> 
http://opensource.atlassian.com/confluence/oss/display/IBATIS/Environment+Specific+Information
>
>
> Ted
>
>
> On 08/07/06, Fred Janon <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I want to convert a string containing a date in the format dd/month/year
>> into a mySQL date format (/mm/dd) in an update statement. I tried:
>>
>>   
>> update jobs
>> set clientid=#clientId#, summary=#summary#,
>> jobduedate=str_to_date(#dueDate#, '%d/%m/%Y')
>> where jobid=#id#
>>   
>>
>> but it doesn't work or even generate an error, it jut stores /00/00
>> in the my SQL DB. I enabled DEBUG on SQL statements and  apparently the
>> generated statement by iBatis is:
>>
>> PreparedStatement: update jobs  set clientid=?, summary=?,
>> jobduedate=?where jobid=?
>> Parameters: [2, Yellow banner 7, 10/10/2000, 3]
>>
>> No sign of my function call at all.
>>
>> Is there a way to get my function call working?
>>
>> Thanks
>>
>> Fred
>>
>>
>>
>>
>>
>>
>





Re: How to use a function on a parameter in an "update" mapped statement?

2006-07-12 Thread Fred Janon

Hi Ted,

Thanks for the suggestion, I looked at the link you mentioned, but I 
don't think that's the issue. It looks like iBatis doesn't even generatr 
the correct statement if the log is correct:


PreparedStatement: update jobs  set clientid=?, summary=?, 
jobduedate=?where jobid=?


In this statement, "jobduedate=?" should actually genarated as 
"jobduedate=str_to_date(?, '%d/%m/%Y')" I think.


I hope someone gives me a pointer here, I have the suspicion that iBatis 
just replaces the right hand side of the '=' by '?' and ignores the 
actual RHS expression.


Fred

Ted Schrader wrote:

Hi Fred,

Does mySQL allow place holders inside of functions for JDBC?  For 
example:


update jobs
set clientid=?, summary=?, jobduedate=str_to_date(?)
where jobid=?

I ran into a similar problem with DB2 on the AS400/iSeries/i5.  Check
out the last entry on
http://opensource.atlassian.com/confluence/oss/display/IBATIS/Environment+Specific+Information 



Ted


On 08/07/06, Fred Janon <[EMAIL PROTECTED]> wrote:

Hi,

I want to convert a string containing a date in the format dd/month/year
into a mySQL date format (/mm/dd) in an update statement. I tried:

  
update jobs
set clientid=#clientId#, summary=#summary#, 
jobduedate=str_to_date(#dueDate#, '%d/%m/%Y')

where jobid=#id#
  

but it doesn't work or even generate an error, it jut stores /00/00
in the my SQL DB. I enabled DEBUG on SQL statements and  apparently the
generated statement by iBatis is:

PreparedStatement: update jobs  set clientid=?, summary=?, 
jobduedate=?where jobid=?

Parameters: [2, Yellow banner 7, 10/10/2000, 3]

No sign of my function call at all.

Is there a way to get my function call working?

Thanks

Fred








begin:vcard
fn:fjanon
n:Janon;Fred
email;internet:[EMAIL PROTECTED]
title:Sr S/W Engineer & Architect
x-mozilla-html:TRUE
url:http://www.geocities.com/fjanon
version:2.1
end:vcard



RE : RE : request using beanExample

2006-07-12 Thread jeremy jardin
A CHAR !!
Why ??


-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé : mercredi 12 juillet 2006 09:50
À : user-java@ibatis.apache.org
Objet : Re: RE : request using beanExample

Is MOBILE a CHAR field or VARCHAR?

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> All my classes have been generated using Abator so, I have something like 
> that :
>
> List list = 
> sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", 
> parms);
>
> Parms contains my where clause, instanciated the good way...
>
> PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
> ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
> Parameters: [0613410836]
> Types: [java.lang.String]
> ResultSet
>
>
> What's the matter with my request ?
>
>
> -Message d'origine-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
> Envoyé: mercredi 12 juillet 2006 09:39
> À: user-java@ibatis.apache.org
> Objet: Re: request using beanExample
>
> Do you have a resultMap or resultClass for the select?
>
> Larry
>
>
> On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > Hello,
> >
> >
> >
> > I'm trying to launch a request using a beanExample .. I've logged the sql
> > request, and I can see that this request should answers 1 result.
> >
> >
> >
> > After all. my resultList is empty, and I don't know why.
> >
> >
> >
> > Any idea ?
> >
> >
>


Re: RE : request using beanExample

2006-07-12 Thread Larry Meadors

Is MOBILE a CHAR field or VARCHAR?

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:

All my classes have been generated using Abator so, I have something like that :

List list = 
sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", parms);

Parms contains my where clause, instanciated the good way...

PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?
Parameters: [0613410836]
Types: [java.lang.String]
ResultSet


What's the matter with my request ?


-Message d'origine-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé: mercredi 12 juillet 2006 09:39
À: user-java@ibatis.apache.org
Objet: Re: request using beanExample

Do you have a resultMap or resultClass for the select?

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hello,
>
>
>
> I'm trying to launch a request using a beanExample .. I've logged the sql
> request, and I can see that this request should answers 1 result.
>
>
>
> After all. my resultList is empty, and I don't know why.
>
>
>
> Any idea ?
>
>



RE : request using beanExample

2006-07-12 Thread jeremy jardin
All my classes have been generated using Abator so, I have something like that :

List list = 
sqlMapClient.queryForList("UTILISATEUR.abatorgenerated_selectByExample", parms);

Parms contains my where clause, instanciated the good way...

PreparedStatement: Select UUID, MOBILE,ORIGINE_UUID,ETAT,LOGIN, 
ETAT_MODIFIE,TSTMPINSR, TSTMPUPDT  from UTILISATEUR where MOBILE = ?










  
Parameters: [0613410836]
Types: [java.lang.String]
ResultSet


What's the matter with my request ?


-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Larry Meadors
Envoyé : mercredi 12 juillet 2006 09:39
À : user-java@ibatis.apache.org
Objet : Re: request using beanExample

Do you have a resultMap or resultClass for the select?

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hello,
>
>
>
> I'm trying to launch a request using a beanExample .. I've logged the sql
> request, and I can see that this request should answers 1 result.
>
>
>
> After all. my resultList is empty, and I don't know why.
>
>
>
> Any idea ?
>
>


Re: request using beanExample

2006-07-12 Thread Larry Meadors

Do you have a resultMap or resultClass for the select?

Larry


On 7/11/06, jeremy jardin <[EMAIL PROTECTED]> wrote:





Hello,



I'm trying to launch a request using a beanExample .. I've logged the sql
request, and I can see that this request should answers 1 result.



After all. my resultList is empty, and I don't know why.



Any idea ?




RE: How can I reuse a resultMap.

2006-07-12 Thread MCCORMICK, Paul
Title: How can I reuse a resultMap.



That issues is resolved in latest 
version:  http://issues.apache.org/jira/browse/IBATIS-225


From: MCCORMICK, Paul 
[mailto:[EMAIL PROTECTED] Sent: Wednesday, 12 July 2006 
3:02 PMTo: user-java@ibatis.apache.orgSubject: How can I 
reuse a resultMap.

I have a resultMap I use to populate a Name 
object.  Here is the class and result map.  
public class Name {     public Integer name_id } 
public class CompanyName extends Name { 
    // has 
may properties } 
public class PersonName extends Name { 
    // has 
may properties } 
          
     
          

How can I use the above resultMap 
definition when the Name class is a property of an object.  The Customer 
class has a Name as a property.  
 
public class Customer { 
    private 
Integer customerId;     
private Name name; } 
             
     
select CUSTOMER_ID, NAME_ID, NAME_TYPE, 
      
I can get it to work is I add a List 
property to the Customer class and use that instead of the Name property..  
E.g 
 
public class Customer { 
    private 
Integer customerId;     // private Name name; 
    private List nameList;  
    
    public 
Name getName() {     
    return 
(Name)getNameList().get(0); 
    }   }  
I don't want to complicate the bean by 
adding getters and setters that are only used by Ibatis.  Is there another 
way to do this?
Thanks, Paul 

  
  
"DISCLAIMER: This email, including 
  any attachments, is intended only for use by the addressee(s) and may 
  contain confidential and/or personal information and may also be the 
  subject of legal privilege. If you are not the intended recipient, you 
  must not disclose or use the information contained in it. In this case, 
  please let me know by return email, delete the message permanently from 
  your system and destroy any copies. Before you take any action 
  based upon advice and/or information contained in this email you should 
  carefully consider the advice and information and consider obtaining 
  relevant independent advice.


request using beanExample

2006-07-12 Thread jeremy jardin








Hello,

 

I’m trying to launch a
request using a beanExample .. I’ve logged the sql
request, and I can see that this request should answers
1 result.

 

After all. my resultList
is empty, and I don’t know why.

 

Any idea ?

 








How can I reuse a resultMap.

2006-07-12 Thread MCCORMICK, Paul
Title: How can I reuse a resultMap.







I have a resultMap I use to populate a Name object.  Here is the class and result map.



public class Name {

    public Integer name_id

}


public class CompanyName extends Name {

    // has may properties

}


public class PersonName extends Name {

    // has may properties

}




  

      

    

    

  






How can I use the above resultMap definition when the Name class is a property of an object.  The Customer class has a Name as a property.  



public class Customer {

    private Integer customerId;

    private Name name;

}




  

  

  

  NameRM"/>







    select CUSTOMER_ID, NAME_ID, NAME_TYPE,     





I can get it to work is I add a List property to the Customer class and use that instead of the Name property..  E.g




public class Customer {

    private Integer customerId;

    // private Name name;

    private List nameList; 

   

    public Name getName() {

        return (Name)getNameList().get(0);

    }   

}



I don't want to complicate the bean by adding getters and setters that are only used by Ibatis.  Is there another way to do this?

Thanks,

Paul






"DISCLAIMER: This email, including any attachments, is intended only for use by the addressee(s) and may contain confidential and/or personal information and may also be the subject of legal privilege. If you are not the intended recipient, you must not disclose or use the information contained in it. In this case, please let me know by return email, delete the message permanently from your system and destroy any copies. 

Before you take any action based upon advice and/or information contained in this email you should carefully consider the advice and information and consider obtaining relevant independent advice.