RE: Extending IBATIs

2007-07-27 Thread Daniel Pitts
Does iBATIS use Introspector and BeanInfo? If it does (and it should!), then you can create a custom BeanInfo class that defines the getter/setter methods for particular properties. From: Clinton Begin [mailto:[EMAIL PROTECTED] Sent: Friday,

RE: conditionally add a table to the from clause just once if either or both of two parameters is not empty

2007-02-22 Thread Daniel Pitts
Perhaps moving that logic out of your xml file into Java land. Assuming you have a Map as the parameter. boolean useSupplierForParts = Boolean.valueOf(parameters.containsKey(supplierCompanyId) || parameters.containsKey(supplierRef)); Parameters.put(supplierTable, useSupplierForParts ? ,

RE: who's using it?

2007-02-13 Thread Daniel Pitts
Off the record, CNET is using it for certain applications. -Original Message- From: Mark Volkmann [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 13, 2007 9:22 AM To: user-java@ibatis.apache.org Subject: who's using it? You know how when you propose using some new software library

RE: Map nullValue to empty collection

2007-02-09 Thread Daniel Pitts
Depending on whether you need to be able to add/remove from the Objects list after its set: public void setObjects(ListObject objects) { this.objects = objects == null ? Collections.emptyList() : objects; } // or public void setObjects(ListObject objects) { this.objects = objects == null

Iterating through Collection.

2007-02-07 Thread Daniel Pitts
I'm passing in a Collection in the parameter map. This allows me to pass in a Set, but ibatis doesn't seem to handle this: com.ibatis.common.beans.ProbeException: The 'ids' property of the java.util.HashMap class is not a List or Array. Seems like a possible bug?

RE: cannot write to property without a setter

2007-02-06 Thread Daniel Pitts
Injection using blah.getFoo().setBar(bar); should be fine. There isn't any setFoo, but its not a private injection. From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 06, 2007 12:31 PM To: user-java@ibatis.apache.org Subject: Re: cannot write

RE: Getting straight at the ResultSet

2007-01-04 Thread Daniel Pitts
iBATIS is used to wrap JDBC, so that you don't have to deal with the low level details. If you want to deal with the low level details, simply don't use iBATIS. You are going to have an overhead if you use wrapper, but the overhead is probably minimal. Do things the normal iBATIS way, and if

RE: Turning Off Ibatis SQL Mapper info..

2006-11-01 Thread Daniel Pitts
Turn logging level to WARN? From: Urban, John [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 01, 2006 12:19 PMTo: user-java@ibatis.apache.orgSubject: Turning Off Ibatis SQL Mapper info.. Cannot figure out how to turn off logging. Not set it conf/log4j.xml of jboss or

RE: Problem addressing list index in a parameter declaration

2006-10-30 Thread Daniel Pitts
Looks like a problem with the way ibatis handles collections. Is it possible to iterate over the addresses, rather than manually select [0] and [1]? Also, might it be better design (if there is always going to be exactly two) to have them be individual properties? streetAddress, apartmentAddress?

RE: Flushing of oscache in a cluster ?

2006-09-21 Thread Daniel Pitts
We ran into a similar problem (same situation) Although, we happened to have an RMI connection between the tool and front-end, so we used that to send "flush" commands. I wouldn't recommend that though, trying to keep the two synchronized was a pain. Actually, I don't know much about

RE: Postgresql serial type problem

2006-09-20 Thread Daniel Pitts
I would guess that you should omit event_id. Instead setting it in your java code to the return valid of the insert() method. From: Okan Çetin [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 20, 2006 5:08 PMTo: user-java@ibatis.apache.orgSubject: Postgresql serial type problem I

RE: dynamic tables names in query problem

2006-09-19 Thread Daniel Pitts
Your iterate tag needs to specify what its iterating. I forget off the top of my head, but I think it's the value attribute. iterate conjunction= union all value=values select * from task_url_$values[]$/iterate -Original Message- From: Eugeny N Dzhurinsky [mailto:[EMAIL PROTECTED]

RE: underscore in java bean property

2006-09-13 Thread Daniel Pitts
Even if they don't follow the spec, here is a work around: Create a object wrapper that DOES follow the spec, and it just delegates to the legacy object. If you can, however, I would refactor it to be more appropriate for modern coding practices. -Original Message- From: Nathan Maves

Populating existing beans...

2006-09-12 Thread Daniel Pitts
I have a MapInteger, MyBean byId; Which was built by byId.put(myBean.getId(), myBean); MyBean is the base class, there are many types of MyBean objects. Is there a away to tell iBATIS to use the bean in byId map as the result object? Or do I have to get the result, and copy the values over

RE: Populating existing beans...

2006-09-12 Thread Daniel Pitts
Thanks for the reply. I'm well aware of queryForMap, but the problem isn't grouping the objects. Basically, I have a bean "graph" (or tree, or whatever) that has been constructed before there is enough information to run the final query. Also, I don't know the bean class before hand (and

RE: Populating existing beans...

2006-09-12 Thread Daniel Pitts
Subject: RE: Populating existing beans... On Tue, 2006-09-12 at 13:49 -0700, Daniel Pitts wrote: To clarify more, I have a bunch of beans of different classes. There is a table for each class of bean, with columns that correspond directly to bean properties. This makes it easy to do things

RE: xml parser errors

2006-09-08 Thread Daniel Pitts
If you read carefully, you'll see that there is no WRITEABLE property named "Firstname" in class "com.domain.User" This means that your com.domain.User class doesn't have a "setFirstname" method. Also, the property should be start with lowercase, e.g. "firstname". From: Okan Çetin

RE: select statement problem

2006-09-08 Thread Daniel Pitts
Try executing the query manually in an sql client. Do you get any results? If not, thats your problem. Also, make sure you're using namespaces properly. From: Okan Çetin [mailto:[EMAIL PROTECTED] Sent: Friday, September 08, 2006 1:12 PMTo: user-java@ibatis.apache.orgSubject: select

RE: Update query

2006-08-24 Thread Daniel Pitts
I think his parameter class has a property named "track" which is a bean with a property named "id". Anyway, I would probably debug (either set a break point, or just println) the value of track and track.getId() before calling this query. From: puneet arya [mailto:[EMAIL PROTECTED]

HashMaps, groupBy, error!

2006-08-24 Thread Daniel Pitts
I'm having a hard time with groupBy and hashmaps. I'm getting an exception: Error instantiating collection property for mapping 'blog'. Cause: java.lang.ClassCastException: java.lang.Object I call queryForMap(getBlogAndCategoriesForContent, parameters, blog, category); When my query completes,

dynamic script's

2006-08-23 Thread Daniel Pitts
Is there a way to run an SQL script from iBATIS? Such as: INSERT INTO foo (#bar#, #baz#); INSERT INTO ho (#hum#); Also, if there is, is it possible to dynamically generate the SQL to do so? Eg: INSERT INTO foo (#bar#, #baz#); iterate property=hosINSERT INTO ho (#bar#, #hos[]#);/iterate Thanks.

RE: dynamic script's

2006-08-23 Thread Daniel Pitts
ple calls to the different insert statements. More portable, and probably more maintainable. Jeff Butler On 8/23/06, Daniel Pitts [EMAIL PROTECTED] wrote: Is there a way to run an SQL "script" from iBATIS?Such as:INSERT INTO foo (#bar#, #baz#); INSERT INTO ho (#hum#);Also, if there i

RE: CDATA inside or outside of statement tag

2006-08-23 Thread Daniel Pitts
I believe the cdata start/end will cause the dynamic tags to be escaped, and therefor not interpreted by iBATIS. I would guess your second suggestion is the correct one. From: Mississippi John Hurt [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 23, 2006 1:01 PMTo:

RE: CDATA inside or outside of statement tag

2006-08-23 Thread Daniel Pitts
or outside of statement tag I tend to not use them at all. The only time I would need them is for the standard less then or greater then symbols. Instead I just use the html code to do this. gt; and lt; On 8/23/06, Daniel Pitts [EMAIL PROTECTED] wrote: I believe the cdata start/end will cause

M:N question

2006-08-23 Thread Daniel Pitts
I have something like the following: class Foo { Integer fooId; String name; MapInteger, ListInteger bar = new HashMapInteger, ListInteger(); // getters/setters bellow. } Table foo has (fooId, name) and table barMap has (fooId, a, b) select id=getFoo resultMap=fullFoo

Map from id-list

2006-08-14 Thread Daniel Pitts
I have a table that looks something like this: external_maps Parent externalId type 1 1 1 1 2 1 1 3 1 1 8 2 1

RE: IBATIS error...

2006-07-28 Thread Daniel Pitts
Perhaps the JUnit test is using a different sqlMap xml file? Check and see. If it is, make sure that the JUnit's sqlMap xml file is valid/correct. -Original Message- From: Henry Lu [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 11:05 AM To: user-java@ibatis.apache.org Subject:

RE: SQL request with optional where

2006-06-14 Thread Daniel Pitts
Try the ibatis website? http://ibatis.apache.org/dotnetdownloads.cgi -Original Message- From: xianwinwin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 1:46 PM To: user-java@ibatis.apache.org Subject: Re: SQL request with optional where thank you larry, could you kindly

RE: One query populating *multiple* lists per object returned

2006-05-11 Thread Daniel Pitts
Honestly, the solution I would choose is very different Make a "Pets" table that has both dog and cat :-) Or, if you must use this schema... When you query for people, do one query for "People with Cats", and one for "People with Dogs" and then merge the results. From: Jeff Butler

Table alias in results map.

2006-03-29 Thread Daniel Pitts
I want to perform a query like: select id=getData resultClass=map parameterClass=string Select * FROM data AS `root:data` JOIN other AS `root:other` JOIN something as `root:other:something` WHERE $where$ /select The tables data, other, and something may or may not have similarly named columns.

HashMap results and column aliased with '.' in the name.

2006-03-17 Thread Daniel Pitts
I want to get a result back as a HashMap with all the columns in the result being keys in the map. It makes sense for my application to have '.'s in the column names, but ibatis is trying to map those to properties of Object instances. Is there any way to tell ibatis to ignore '.'s in the column

RE: Re: HashMap results and column aliased with '.' in the name.

2006-03-17 Thread Daniel Pitts
: HashMap results and column aliased with '.' in the name. You can remap in sql w/ as or map the fields in XML. .V Daniel Pitts wrote: I want to get a result back as a HashMap with all the columns in the result being keys in the map. It makes sense for my application to have '.'s in the column