resultClass, properties not set

2008-08-08 Thread Ingmar Lötzsch
Hallo, I'am using Ibatis 2.3.0.677. Under certain circumstances properties of the result class are not set, although contained in the result map. This happens, when the only property of a result map is mapped to a result map. The essence is, that resultMap id=resultIdOnly class=Type2

Re: 2.3.3 and Spring? Good to go?

2008-08-08 Thread Ingmar Lötzsch
I'am using iBatis 2.3.0.677 with Spring 2.5.2. spring.jar (2008-03-01) aspectjweaver.jar (v. 1.5.4 I think) cglib-nodep-2.1_3.jar Ian Zabel schrieb: I've seen some recent traffic on this list saying that Spring is incompatible with iBatis 2.3.x. Is this still the case, or have these issues

execution of nested result maps depends on number of mapped properties?

2008-10-23 Thread Ingmar Lötzsch
Hello, I found a behaviour in iBATIS, what I don't unterstand. Dependend on the list of properties selected in a statement joining 3 tables the execution of a nested result map results in an instantiation or not. iBATIS: 2.3.4.726 Spring: 2.5.2 I have 3 tables (I omit the unnecessary

Re: execution of nested result maps depends on number of mapped properties?

2008-10-23 Thread Ingmar Lötzsch
Hello, I found the reason for my problem is the following method in class ResultMap, line 310: public Object[] getResults(StatementScope statementScope, ResultSet rs) throws SQLException { ... boolean foundData = false; Object[] columnValues = new

Re: execution of nested result maps depends on number of mapped properties?

2008-10-23 Thread Ingmar Lötzsch
at 6:37 AM, Ingmar Lötzsch [EMAIL PROTECTED] wrote: Hello, I found the reason for my problem is the following method in class ResultMap, line 310: public Object[] getResults(StatementScope statementScope, ResultSet rs) throws SQLException { ... boolean foundData = false; Object

Re: JSF configuration with Spring?

2008-10-31 Thread Ingmar Lötzsch
Hi, I'm using JSF 1.2 (with backwards combatibility for 1.1), Spring 2.5.2, and iBATIS 2.3.4.726. My configuration contains the following: web.xml ... listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener listener

Re: update with parameterMap and parameterClass ?

2008-11-26 Thread Ingmar Lötzsch
Could I use an update statement using a parameterMap and a parameterClass ? How to use a parameterClass property? Example: update id=update1 parameterMap=personMap parameterClass=Person UPDATE Person SET name=?,lastname=? WHERE id = (how to reference the value from parameter class Person

Re: howto do iteration with UNION

2008-12-04 Thread Ingmar Lötzsch
problem: I wish to get the production of a client through different period of times. the simple most sql will be: *** SQL ** SELECT client_ID, SUM(production) , #date1# AS start_date, #date2# AS end_date FROM client_production WHERE client_ID=33293 AND production_date

Re: unsigned bigint

2009-01-16 Thread Ingmar Lötzsch
Anyone run into mapping an unsigned BIGINT? I don't see how its possible in Java? Why can't you use Long or long?

Re: SQL Mapping is not working

2009-01-16 Thread Ingmar Lötzsch
Petr V. schrieb: Any idea what is going on ? :-( It is straight forward code == resultMap class=Job id=JobResult result column=JOB_ID jdbcType=INTEGER property=jobId / result column=STATUS jdbcType=INTEGER javaType=JobStatusEnum

Re: 2 Way 1-1 relationship

2009-01-22 Thread Ingmar Lötzsch
Actually I was simplifying the context from 1-M to 1-1 for discussion so left groupBy attribute mistakenly. The problem at hand is that Teacher has students (1:M). Student must have some teacher assigned to him but teacher does not necessarily need to have some student. So I go ahead and

Re: Data mapper help ...please

2009-02-04 Thread Ingmar Lötzsch
Hello Rahul, I am very new to Ibatis so I need some help in regard to, How I can register my ArrayToStringtypehandlercallback for a particular field. 1) I know that I can declare my typehandler in sqlmapConfig file but if I do so, that means declaring it for every parameter of the same

Re: Insert help

2009-02-04 Thread Ingmar Lötzsch
Hello Rahul, here an example for Date[]/date[] Can any one tell me how to use typehandlercallback implementation with sqlmap while doing insert public void insert(Planschichteinheit record) { getSqlMapClientTemplate().insert(planschichteinheit.insert, record); } and one more

Re: Insert help

2009-02-04 Thread Ingmar Lötzsch
Hello Rahul, Really appreciate your response, Well I do need to bother you for one more thing if you could tell me where exactly do I need to insert the following statement (In my sqlmap-config.xml file or under my resource file). typeAlias alias=DateArrayTypeHandler

Re: Need help on Inserting child Object .

2009-02-08 Thread Ingmar Lötzsch
Hello, Rahul if (null == order.getOrderId()) { sqlMapClient.insert(Order.insert, order); } else { sqlMapClient.update(Order.update, order); } As I was going through above code I have few question why are checking it against null for insert , shouldn’t that be checking for not null

Re: Need help on Inserting child Object .

2009-02-09 Thread Ingmar Lötzsch
Hello Rahul, I am Using postgresSql As my DB and I am using auto-generated keys as my way to create new ID which is as follows: insert id=MSCPerfCntrMscMMSTblImpl parameterClass=com.hns.hss.nmf.server.log.manager.gensrc.MSCPerformance.impl.MSCPerfCntrMscMMSTblImpl insert into

Re: Need help on Inserting child Object .

2009-02-09 Thread Ingmar Lötzsch
Hello Rahul, I have gone through the link you gave me here is what is been given there insert id=InsertOrganization parameterClass=Organization resultClass=int selectKey property=Id type=post resultClass=int SELECT cast(last_value as int) AS value

Re: Need help on Inserting child Object .

2009-02-09 Thread Ingmar Lötzsch
Hello Rahul, Well I could not understand what you actually mean to say by this This works only, if there are no depedencies to the child table and if you don't have to log the changes This refers to the use of DELETE during the UPDATE only. If there is a third table with FOREIGN KEY

Re: KeyProperty attribute in Selectkey Tag

2009-02-13 Thread Ingmar Lötzsch
Well I do have sequences defined for my each table which acts as a primary key for my table now I want to use this generatedkey as a foreign key in another table so now if I use my class attribute to have this sequence id , then how can I get that key in java code , I am assuming I can do in

Re: Recursive Select in SqlMap throws java.sql.SQLException: Exhausted Resultset

2009-02-26 Thread Ingmar Lötzsch
This is the first time I used Ibatis in a project and I'm stucked on this error. Exhausted Resultset. My problem started when i designed my model class like the following: class MyObject { private String id; private String parentId; private String rootId; private MyObject root;

Re: Recursive Select in SqlMap throws java.sql.SQLException: Exhausted Resultset

2009-02-27 Thread Ingmar Lötzsch
Hello Sean, sorry for answering late. I was too busy today. Do you mean that Ibatis cannot handle Circular dependencies? If that's the case then its not possible to call a single recursive statement from a sqlmap? I'm not an expert for your case, because I'm not using the select attribute.

Re: iBatis , JSP classes

2009-03-13 Thread Ingmar Lötzsch
works fine inside java classes, but return the follow error when I run it inside a JSP page : com.ibatis.sqlmap.client.SqlMapException: There is no statement named SelUsers in this SqlMap SelUsers ^ A typo somewhere in your DAOs?

Re: Parsing Error for =

2009-03-16 Thread Ingmar Lötzsch
I prefere to change the order of the operands, because then is no need to use CDATA sections or XML entities. AND EXPECTED_DAY = ACTUAL_DAYS Kengkaj Sathianpantarit schrieb: Don't forget that you are using XML, use CDATA as follows. ![CDATA[ = ]] Kengkaj On Mon, Mar 16, 2009 at 7:38 AM,

Re: Parsing Error for =

2009-03-16 Thread Ingmar Lötzsch
Kengkaj On Mon, Mar 16, 2009 at 3:56 PM, Ingmar Lötzsch iloetz...@asci-systemhaus.de mailto:iloetz...@asci-systemhaus.de wrote: I prefere to change the order of the operands, because then is no need to use CDATA sections or XML entities. AND EXPECTED_DAY = ACTUAL_DAYS Kengkaj

Re: Please help with mapping Ibatis

2009-03-31 Thread Ingmar Lötzsch
I have a class public class Part{ private Integer id; private String name; private Bar bar; getters/setters } I have a mapping for part and for there part I am adding aliases for column names after join. I am sure it is not correct way to do it. Please advice how to do

Re: Please help with mapping Ibatis

2009-03-31 Thread Ingmar Lötzsch
So only way is to do with aliases? No way I can reuse the already mapped dto other then remap it? You can use the select attribute instead of resultMap. You can combine this with lazy loading. Ingmar

Re: [resultMap] related objects

2009-04-02 Thread Ingmar Lötzsch
...and there is a problem with resultMap: You should explane the problem. What exceptions? What table structures? something like that doesn't work: resultMap id=addr-result class=Address result property=addressId column=.. / result property=street column=.. / /resultMap resultMap

Re: [resultMap] related objects

2009-04-02 Thread Ingmar Lötzsch
Do I have to use TypeHandler? But how? You don't need a custom TypeHandler. But perhaps you have to provide more information. What are the column names of the tables companies and adresses? Your first message shows that they are different from the class properties. Which packages contain the

Re: [resultMap] related objects

2009-04-02 Thread Ingmar Lötzsch
I get exception: --- Check the company.company-result. --- The error happened while setting a property on the result object. --- Cause: com.ibatis.sqlmap.client.SqlMapException: Error instantiating collection property for mapping 'address'. Cause: java.lang.ClassCastException: The

Re: Can I use Set instead of List?

2009-04-07 Thread Ingmar Lötzsch
This is a fundamental java issue. You will never be able to cast a list to a set because a list allows duplicates whereas a set dose not. The duplicates are not the reason. ArrayList is not a subtype of Set. And how does the query select * from Products produce duplicates? Lists accept

Re: Update Postgres Array with IBatis

2009-04-07 Thread Ingmar Lötzsch
Hello, I need to update an array of integers in Postgres with Ibatis 2.3.4 (and Spring). I want to execute the following query: UPDATE data SET='{1,2}' WHERE dataid=10 I prefer the use of java.sql.Array and a custom TypeHandler. The query is update id=updateQuery

Re: Populating a Pojo with two ArrayLists

2009-08-19 Thread Ingmar Lötzsch
I'm trying to populate a pojo with two array lists and my code doesn't do what I intended The pojo has two arrayLists as memebers one called 'dates' the other 'values' Why can't you create class DateValuePair { private Date date; private Double value; ... getter,

Re: IBatis Array feild insertion problem in postgres database()Please help me)

2009-10-08 Thread Ingmar Lötzsch
You can use a type handler and implement java.sql.Array. Example: 1st: abstract superclass as adapter public abstract class SqlArrayAdapter implements Array { public Object getArray() throws SQLException { // Auto-generated method stub return null;

Re: IBatis Array feild insertion problem in postgres database()Please help me)

2009-10-12 Thread Ingmar Lötzsch
, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase] Ingmar Lötzsch wrote: You can use a type handler and implement java.sql.Array. Example: 1st: abstract superclass as adapter public abstract class SqlArrayAdapter implements Array { public Object getArray() throws SQLException

Re: IBatis Array feild insertion problem in postgres database()Please help me)

2009-10-14 Thread Ingmar Lötzsch
-InlineParameterMap. --- Check the parameter mapping for the 'kmsgroupactive' property. --- Cause: java.lang.NullPointerException Ingmar Lötzsch wrote: INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] INFO does not mean there was thrown an exception. What

Re: Select Query 'LIKE' Issue

2009-10-15 Thread Ingmar Lötzsch
If || is the operator for string concatenation, try like '$pattern$' || '%' respectively like '%' || '$pattern$' || '%' gonas schrieb: Hello , I am using Ibatis 2.3.Issue Persist as Below mentioned. Query in Respective Configuration XML As: select id=getSerialNumber

Re: IBatis Array feild insertion problem in postgres database()Please help me)

2009-10-26 Thread Ingmar Lötzsch
the recommended tests. jishnu123 schrieb: Dear Ingmar Lötzsch, Still, I am facing the problem for inserting array field through iBatis.. Current error list as follows... Errors List in insert groups::SqlMapClient operation; uncategorized SQLException for SQL

Re: IBatis Array feild insertion problem in postgres database()Please help me)

2009-10-26 Thread Ingmar Lötzsch
Sorry, I have maked a mistake: Your version of IntArrayTypeMapper expects a CollectionInteger but actual parameter is of type org.ada.kms.domain.IntArray because you let iBATIS call getKmsgrpaccessiblegroup(): #kmsgrpaccessiblegroups,handler=KmsArrayTypeMapper# must be

Re: how to pass two different types of values to query in IBATIS

2010-04-14 Thread Ingmar Lötzsch
I prefer the use of java.sql.Array and a custom TypeHandler and to keep the sql as simple as possible. Here is an example for Ibatis 2. Create an IntArrayTypeHandler class and register it in the config. public class IntArrayTypeHandler implements TypeHandlerCallback { public void