Re: Spring iBatis question

2007-05-17 Thread Mark Volkmann
On May 17, 2007, at 10:34 AM, Sergey Livanov wrote: I use Spring Dao + iBatis and I have to run into the one transaction inserts order document. ( insert into header values( docpk, docnum, docdate, client ) and many inserts as insert into( docfk, itempk, good, price, quantity ). I do not know

1:N select issue

2007-04-13 Thread Mark Volkmann
I'm using groupBy to avoid a 1:N select. I've simplified what I'm doing to isolate the problem. The relationships between my object model classes are as follows. A Store has - a storeGeneral property that is a StoreGeneralModel object - a phones property that is a List of PhoneModel objects

Re: 1:N select issue

2007-04-13 Thread Mark Volkmann
See the solution below. On Apr 13, 2007, at 10:14 AM, Mark Volkmann wrote: I'm using groupBy to avoid a 1:N select. I've simplified what I'm doing to isolate the problem. The relationships between my object model classes are as follows. A Store has - a storeGeneral property

mapping to objects that have multiple list properties

2007-04-13 Thread Mark Volkmann
Suppose I have person, address and phone tables. address has a foreign key to person. phone has a foreign key to person. A person can have multiple addresses and multiple phones. I want to create an iBATIS mapped select that retrieves a person and all their addresses and phones. This has been

N+1 select and groupBy

2007-04-12 Thread Mark Volkmann
I've got a simple situation where Store objects have a property that is a collection of Phone objects. I've read the section in the iBATIS documentation and the book that discusses how to setup this kind of mapping using the resultMap groupBy attribute. My select takes a storeID, so I

Abator-generated model object classes with toString

2007-04-11 Thread Mark Volkmann
As far as I can tell, there isn't a way to configure Abator to generate toString methods in Java model classes other than writing a custom generator. Is that correct? Has someone written a custom generator that adds toString methods that they can share?

Abator and bit column types

2007-04-10 Thread Mark Volkmann
For database columns of type bit, Abator is generating model object fields with a type of Object. How can I make it use a type of Boolean instead?

Re: Abator and bit column types

2007-04-10 Thread Mark Volkmann
On Apr 10, 2007, at 2:37 PM, Mark Volkmann wrote: For database columns of type bit, Abator is generating model object fields with a type of Object. How can I make it use a type of Boolean instead? Found it. columnOverride column=some-column-name javaType=Boolean/

Abator-generated model classes and primitive types

2007-04-06 Thread Mark Volkmann
It seems that by default Abator-generated model classes use type wrappers instead of primitive types for fields that correspond to database table columns. For example, a table with a column of type int will have a corresponding model object field of type Integer. Why aren't primitive types

Re: Abator-generated model classes and primitive types

2007-04-06 Thread Mark Volkmann
it's not a big deal. Abator's default behavior is to use objects, but you can force a primitive with a columnOverride if you want to. Thanks for the explanation! Jeff Butler On 4/6/07, Mark Volkmann [EMAIL PROTECTED] wrote: It seems that by default Abator-generated model classes use type

Re: Transaction Control across multiple datasources

2007-03-29 Thread Mark Volkmann
On Mar 29, 2007, at 9:23 AM, Seth Helstrip wrote: I'm relatively new to iBatis and am hoping someone can offer me some form of transaction management advise? I'm using Spring MVC with iBatis, and so far, have been mightily impressed with both technologies. Within my application I have the need

Re: SQL Server JDBC drivers

2007-03-27 Thread Mark Volkmann
maart 2007 20:33 To: 'Mark Volkmann' Subject: RE: SQL Server JDBC drivers Sure: insert id=Example_insert parameterClass=Example INSERT INTO example (example_column) VALUES (#exampleColumn#) selectKey keyProperty=exampleId resultClass=int SELECT @@IDENTITY AS ID /selectKey /insert iBATIS

SQL Server JDBC drivers

2007-03-21 Thread Mark Volkmann
If you have successfully used iBATIS with SQL Server, can you tell me what JDBC driver(s) have worked for you?

Re: Abator generated SqlMap.xml files

2007-03-20 Thread Mark Volkmann
and specify the default database name on the connection URL. Jeff Butler On 3/19/07, Mark Volkmann [EMAIL PROTECTED] wrote: When I run Abator against a MySQL database I get files with names like {table-name}_SqlMap.xml. When I run against Postgres or SQL Server I

Postgres JDBC driver

2007-03-20 Thread Mark Volkmann
On Mar 20, 2007, at 10:06 AM, Mark Volkmann wrote: Postgres has a notion of a search path that is a list of schemas that are searched to find databases. I think I need to add my schema to the search path, but I don't know how to do that. Any ideas? I'm making progress. I have some code

Postgres and generated keys

2007-03-20 Thread Mark Volkmann
Abator generates this in an SqlMap.xml file. insert id=abatorgenerated_insert parameterClass=com.savealot.xademo.model.Address !-- WARNING - This element is automatically generated by Abator for iBATIS, do not modify. This element was generated on Tue Mar 20 11:15:50 CDT

Re: AbatorConfig.xml and entities

2007-03-17 Thread Mark Volkmann
. I'm working on a Mac and using Java 5 and Ant 1.7. I got the following. BUILD FAILED java.lang.NoSuchMethodError: org.apache.tools.ant.types.resources.Resources.dieOnCircularReference()V Do you think this is due to using Ant 1.7 instead of 1.6? Jeff Butler On 3/17/07, Mark Volkmann [EMAIL

Re: transactions with Spring DAOs

2007-03-14 Thread Mark Volkmann
I wrote some JDBC code this morning to verify that the version of MySQL I'm using and the driver I'm using is handling transactions correctly and it is. That brings me back to Spring DAOs generated by Abator. I'm convinced that simply calling the SqlMapClient startTransaction method does

transactions with Spring DAOs

2007-03-13 Thread Mark Volkmann
I seem to be getting automatic transactions when I use Spring DAOs generated by Abator even though my SqlMapConfig.xml contains the following. transactionManager type=JDBC dataSource type=SIMPLE ... Here's the simple bit of code I'm using to test this. The change to addressId is

Re: iBATIS in Indianapolis

2007-03-02 Thread Mark Volkmann
On Mar 1, 2007, at 5:31 PM, Ted Schrader wrote: Hi Mark, Thanks for the link to your Abator page, but unfortunately it's coming up blank for me (both IE and FFox). Oops! I've fixed it. Try http://www.ociweb.com/mark/Abator.html again. (Good luck in the Little Rock Marathon this Sunday, by

parameters in select statements and performance

2007-02-22 Thread Mark Volkmann
Just checking my understanding ... Is it the case that select statements that use # placeholders perform better than those using $ placeholders when executed multiple times? Is this because the compiled query is saved by the database so it can be reused later with different parameter

XA transactions

2007-02-14 Thread Mark Volkmann
Can iBATIS work with XA transactions? I surfed the web and came up empty on this.

Re: XA transactions

2007-02-14 Thread Mark Volkmann
On Feb 14, 2007, at 4:56 PM, [EMAIL PROTECTED] wrote: Yes, so long as you use an external transaction manager. Thanks! Can you give me a few examples of these products that I can google to get more information? From: Mark Volkmann [EMAIL PROTECTED] [mailto:Mark Volkmann [EMAIL PROTECTED

who's using it?

2007-02-13 Thread Mark Volkmann
You know how when you propose using some new software library and someone always asks Who else is using it?? Well that's where I am now with iBATIS. I'm trying to convince a client that iBATIS is a good solution for them. Is there a list of companies that are using iBATIS somewhere?

Re: who's using it?

2007-02-13 Thread Mark Volkmann
Thanks for all the feedback! I've compiled a list an added it to my page of notes on iBATIS at http://www.ociweb.com/mark/iBATIS.html. I also have notes on Abator at http://www.ociweb.com/mark/Abator.html. Feedback on both is welcomed!

Abator overwriting generated SqlMap XML files

2007-02-09 Thread Mark Volkmann
I'm running Abator from an Ant target like this. java jar=${abator.jar} fork=true !-- true to overwrite existing files, with the same name. false to save newly generated files with a unique name (dot number at end) -- arg line=AbatorConfig.xml false/

getting auto-gen key after insert

2007-02-08 Thread Mark Volkmann
I used Abator to generate Spring DAOs. When I use the insert method of the generated DAOs to insert a new row in a table, how can I get the primary key that was assigned to the record when it is set in the table definition to auto-generate an integer key? When I just use iBATIS without

Re: getting auto-gen key after insert

2007-02-08 Thread Mark Volkmann
On Feb 8, 2007, at 12:55 PM, Jeff Butler wrote: You need to add a generatedKey element to your Abator configuration. Then Abator will generate the proper selectKey element. Thanks! That fixed it. On 2/8/07, Mark Volkmann [EMAIL PROTECTED] wrote: I used Abator to generate Spring DAOs

DAO select methods and joins

2007-02-08 Thread Mark Volkmann
Just verifying that I understand this correctly ... The selectByExample methods in the DAO classes generated by Abator can only perform queries on columns in a single table. If a query requires a join, one should add mapped statements to the generated SqlMap.xml files and invoke them in

camel-cased column names

2007-02-06 Thread Mark Volkmann
I'm trying to use Abator with a table where the column names are camel-cased. In the generated Java code, for a column like AccountType, methods like getAccounttype get generated. Note the lowercase t at the beginning of type. Is there a way to get the generated method name to be

JAR that contains com.ibatis.dao.client package

2007-02-06 Thread Mark Volkmann
I can't find the JAR that contains the .class files for the com.ibatis.dao.client. Some of the generated Java classes use the class DaoManager from that package. Currently I only have one JAR file for iBATIS and one for Abator and neither of them contain that class.

Re: JAR that contains com.ibatis.dao.client package

2007-02-06 Thread Mark Volkmann
, there is a seperate download for it on the Java dowloads page. I'm fine with using the recommended approach. Thanks! I'm able to compile now. Onto getting it to run! ;-) On 2/6/07, Mark Volkmann [EMAIL PROTECTED] wrote: I can't find the JAR that contains the .class files

Re: inserting a record with a foreign key

2007-01-31 Thread Mark Volkmann
, the name tells you exactly which file it is in. Wonderful! This is MUCH better than what I was doing. Thank you very much for all your help! Larry On 1/30/07, Mark Volkmann [EMAIL PROTECTED] wrote: Here's my situation. I have an artists table and a recordings table in a MySQL database. The artists

inserting a record with a foreign key

2007-01-30 Thread Mark Volkmann
Here's my situation. I have an artists table and a recordings table in a MySQL database. The artists table has the columns id and name. The recordings table has the columns id, name, year and artist_id (a foreign key to the artists table). I have Artist and Recording POJO classes. The