-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Custom *Dao in SimpleJobRepository #4642
Unanswered
nxtruong72
asked this question in
Q&A
-
Hi all,
I need to make the JobRepository run with Hibernate Connection (with Schema Multitenancy) instead of using the JdbcTemplate.
I've done the custom class for JobInstanceDao and now I don't know the way to inject to the SimpleJobRepository and use it.
I've tried to do custom the JobRepositoryFactoryBean and override this method:
@Override
protected JobInstanceDao createJobInstanceDao() {
return myJobInstanceDao;
}
And here is the xml configuration:
<bean id="jobInstanceDao" class="com.MyJobInstanceDao">
<constructor-arg ref="sessionFactory" />
</bean>
<bean id="jobRepositoryFactory" class="com.MyJobRepositoryFactoryBean">
<property name="dataSource" ref="jobDataSource" />
<property name="transactionManager" ref="jobTransactionManager" />
<property name="jobInstanceDao" ref="jobInstanceDao" />
</bean>
<bean id="jobRepository" factory-bean="jobRepositoryFactory" factory-method="getObject" />
But it didn't work, can anyone help me?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
What, specifically, didn't work? Do you have an error or stack trace?
If you want to use custom DAOs, you can define a bean of type SimpleJobRepository
and autowire your custom DAOs in it.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment