Hey forgot to add this. Could you just send me the implementation that would
work as a PersonDaoIBatis.java
------------------------------------
package com.datel.ednrd.ports.dao.ibatis;
import java.util.HashMap;
import java.util.List;
import org.springframework.orm.*;
import com.datel.ednrd.ports.model.Person;
import com.datel.ednrd.ports.dao.PersonDao;
import org.appfuse.model.BaseObject;
import org.apache.commons.lang.StringUtils;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.orm.ObjectRetrievalFailureException;
public abstract class PersonDaoIBatis extends SqlMapClientDaoSupport
implements PersonDao {
public List<Person> findByLastName(String lastName) {
return getSqlMapClientTemplate().queryForList("getPersons", null);
}
}
-------------------------------------
Frankee787 wrote:
>
> Thanks Matt,
> Well what i did is i ran my code with mvn test-compile
> -Ddao.framework=ibatis. I believe it downloaded the dependency files for
> iBatis then. Now I have some problems with the implementation and the
> configuration files. I have added them here. Kindly advice for any
> implementation issues. I would really appreciate if you could list out an
> example like this, no need for a tutorial.
>
> -------------------------------------------------------
> package com.datel.ednrd.ports.dao;
>
> import org.appfuse.dao.GenericDao;
> import com.datel.ednrd.ports.model.Person;
>
> import java.util.List;
>
> public interface PersonDao<T, PK extends java.io.Serializable> extends
> GenericDao {
> public List<Person> findByLastName(String lastName);
>
>
> }
>
> -------------------------------------------------------
> package com.datel.ednrd.ports.dao;
>
> import org.appfuse.dao.GenericDao;
> import com.datel.ednrd.ports.model.Person;
>
> import java.util.List;
>
> public interface PersonDao<T, PK extends java.io.Serializable> extends
> GenericDao {
> public List<Person> findByLastName(String lastName);
>
>
> }
>
> ----------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
>
> <!-- Transaction manager for a single JDBC DataSource -->
> <bean id="transactionManager"
> class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
> <property name="dataSource"><ref bean="dataSource"/></property>
> </bean>
>
> <bean id="sqlMapClient"
> class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
> <property name="configLocation">
> <value>sql-map-config.xml</value>
> </property>
> <property name="dataSource" ref="dataSource"/>
> </bean>
>
> <!--Person-START-->
> <bean id="personDao"
> class="com.datel.ednrd.ports.dao.ibatis.PersonDaoIBatis">
> <property name="dataSource"><ref bean="dataSource"/></property>
> <property name="sqlMapClient"><ref
> local="sqlMapClient"/></property>
> </bean>
> <!--Person-END-->
>
>
> <bean id="personManager"
> class="org.appfuse.service.impl.GenericManagerImpl">
> <constructor-arg>
> <bean class="org.appfuse.dao.ibatis.GenericDaoiBatis">
> <constructor-arg
> value="com.datel.ednrd.ports.model.Person"/>
> </bean>
> </constructor-arg>
> </bean>
>
> </beans>
>
>
>
> -------------------------------------------------
>
>
>
>
> mraible wrote:
>>
>> You're a bit ahead of the curve here. I haven't written an iBATIS
>> tutorial because it's still a bit difficult to switch persistence
>> frameworks. I wrote up a FAQ on this:
>>
>> http://appfuse.org/display/APF/FAQ#FAQ-daoframeworks
>>
>>
>>
>>> How can I change my AppFuse-generated project to use iBATIS or JPA?
>>>
>>> Maven doesn't support overriding properties in dependencies. This
>>> means the only way to switch a DAO framework is to:
>>>
>>> 1. Specify -Ddao.framework=jpa on the command line or in MAVEN_OPTS.
>>> 2. Checkout AppFuse from Subversion, change the <dao.framework>
>>> property in the root pom.xml and install in your repository.
>>>
>>> #2 is the recommended solution for now, but it also requires you to
>>> setup a central repository for your organization.
>>>
>>> Another suggested solution is to create archetypes for each of the web
>>> framework + persistent framework options. However, if we create
>>> archetypes for each possibility, we'll end up with 24 archetypes!
>>> That's a lot to maintain IMO. If we add Ant-based full-source
>>> archetypes to the mix, we're up to 36 archetypes. Add in a couple more
>>> web frameworks and we're up to 60 archetypes. Of course, if there was
>>> a way to programmatically create the archetypes from existing sources,
>>> that's a different story.
>>>
>>
>> Hope this helps,
>>
>> Matt
>>
>> On 3/24/07, Frankee787 <[EMAIL PROTECTED]> wrote:
>>>
>>> I have been having some problem in implementing iBatis for persistence.
>>> Could
>>> anyone suggest as to how this could be achieved. The hibernate works
>>> fine
>>> with help of a tutorial, but still have problems with iBatis. Am using
>>> AppFuse 2 M4. A woring example would be the best if anyone could put
>>> one.
>>>
>>>
>>> Thanks,
>>> Franklin.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-use-iBatis-in-AppFuse-2-tf3458855s2369.html#a9650390
>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>> --
>> http://raibledesigns.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/How-to-use-iBatis-in-AppFuse-2-tf3458855s2369.html#a9658127
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]