Sqlite catalog and schema settings (for MyBatis generator)

Posted by user1769754 on Stack Overflow See other posts from Stack Overflow or by user1769754
Published on 2012-10-23T22:59:30Z Indexed on 2012/10/23 23:00 UTC
Read the original article Hit count: 1055

Filed under:
|
|

I have been trying to use the MyBatis generator on a Sqlite database but can't seem to find what settings to use for the XML attributes catalog and schema.

The generator errors with "Generation Warnings Occured: Table configuration with catalog main, schema sqlite_master, and table testTable did not resolve to any tables"

I can't find much from the sqlite website other than this which gives something like catalog = main, schema = sqlite or sqlite_master

My generator XML file is

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration >
  <context id="context">
    <jdbcConnection driverClass="org.sqlite.JDBC" connectionURL="jdbc:sqlite:testDB.sqlite" userId="" password="" ></jdbcConnection>
    <javaModelGenerator targetPackage="model" targetProject="test/src" ></javaModelGenerator>
    <sqlMapGenerator targetPackage="model" targetProject="test/src" ></sqlMapGenerator>
    <javaClientGenerator targetPackage="model" targetProject="test" type="XMLMAPPER" ></javaClientGenerator>
    <table catalog="main" schema="sqlite_master" tableName="testTable" >
      <property name="useActualColumnNames" value="true"/> 
    </table>
  </context>
</generatorConfiguration>

I have also tried other combinations like

<table catalog="main" schema="sqlite" tableName="testTable" >

<table schema="sqlite" tableName="testTable" >

<table schema="sqlite_master" tableName="testTable" >

<table schema="main.testTable" tableName="testTable" >

Anyone here know the right settings?

© Stack Overflow or respective owner

Related posts about sqlite

Related posts about schema