Hello
I am new to iBatis and am trying to get started with the Beta version of
iBatis 3.0.
I have set up a very simple test for myself this includes
An interface that defines the query
=========
package com.aimhedge.trading.database;
import java.util.List;
import org.apache.ibatis.annotations.Select;
public interface BackAdjFutureMapper {
@Select("select * from back_adj_future " +
"where feed = #{feed} " +
"and instrument = #{instrument} " +
"and periodicity = 'DAILY' " +
"and field = #{field}")
List<BackAdjFuture> selectBackAdjFuture(BackAdjFuture
args);
=========
A class that maps getters and setters for all the columns in the table
back_adj_future and a top level class to test the simple select
=======
package com.aimhedge.trading.database;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
public class MarketData {
private SqlSessionFactory sqlSessionFactory;
private SqlSession session;
MarketData() throws IOException
{
String resource = "Configuration.xml";
Reader reader = Resources.getResourceAsReader(resource);
this.sqlSessionFactory = new
SqlSessionFactoryBuilder().build(reader);
this.session = sqlSessionFactory.openSession();
try
{
BackAdjFuture args = new BackAdjFuture();
args.setFeed("CSI");
args.setInstrument("BO");
args.setField("CLOSE");
BackAdjFutureMapper mapper =
this.session.getMapper(BackAdjFutureMapper.class);
List<BackAdjFuture> backAdjustedBoClose = mapper.selectBackAdjFuture(args);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
finally
{
session.close();
}
}
public static void main(String args[]) throws IOException
{
MarketData runIt = new MarketData();
}
}
=======
The code compiles fine but when I run it I get the message
Type interface com.aimhedge.trading.database.BackAdjFutureMapper is not
known to the MapperRegistry.
It should be noted that in the Configuration.xml file that I pass in I
commented out the <mappers> section as I figured that I only had an
interface and no XML sqlMapper file. This is probably wrong but if it is I
don't know what to do.
Is anyone able to enlighten me as to what this means?
Thanks
Richard
--
View this message in context:
http://www.nabble.com/not-known-to-the-MapperRegistry-with-iBatis-3.0-tp25007484p25007484.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]