Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure datatypeFactory for the Custom IDatabaseConnections? #67

Closed
haocao opened this issue Jan 30, 2015 · 2 comments
Closed

How to configure datatypeFactory for the Custom IDatabaseConnections? #67

haocao opened this issue Jan 30, 2015 · 2 comments

Comments

@haocao
Copy link

@haocao haocao commented Jan 30, 2015

I need to config the datatypeFactory(eg:MysqlDataTypeFactory) inside of the applicationContext.xml of dbUnitDatabaseConfig, could you tell me how to config it into the below configurations?Thanks

Custom IDatabaseConnections

<bean id="dbUnitDatabaseConfig" class="com.github.springtestdbunit.bean.DatabaseConfigBean">
    <property name="skipOracleRecyclebinTables" value="true"/>
</bean>
<bean id="dbUnitDatabaseConnection" class="com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean">
    <property name="databaseConfig" ref="dbUnitDatabaseConfig"/>
</bean>
@philwebb
Copy link
Contributor

@philwebb philwebb commented Jan 30, 2015

You should be able to use the datatypeFactory property. Something like this:

<bean id="dbUnitDatabaseConfig" class="com.github.springtestdbunit.bean.DatabaseConfigBean">
    <property name="skipOracleRecyclebinTables" value="true"/>
    <property name="datatypeFactory" ref="dbUnitDataTypeFactory"/>
</bean>
<bean id="dbUnitDataTypeFactory" class="org.dbunit.ext.mysql.MySqlDataTypeFactory">
</bean>
<bean id="dbUnitDatabaseConnection" class="com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean">
    <property name="databaseConfig" ref="dbUnitDatabaseConfig"/>
</bean>

@ghost
Copy link

@ghost ghost commented Dec 21, 2017

Is it possible to do this through annotations? I need to supply data type factory for Postgres to that UUID columns are detected by DbUnit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants