Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom *Dao in SimpleJobRepository #4642

Unanswered
nxtruong72 asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter

AltStyle によって変換されたページ (->オリジナル) /