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

refactor DataSource #1556

Merged
merged 1 commit into from
Aug 24, 2024
Merged

refactor DataSource #1556

merged 1 commit into from
Aug 24, 2024

Conversation

goekay
Copy link
Member

@goekay goekay commented Aug 24, 2024

  • make DataSource a spring bean
  • move checkJavaAndMySQLOffsets() into GenericRepository
  • necessary consequential changes

* make DataSource a spring bean
* move checkJavaAndMySQLOffsets() into GenericRepository
* necessary consequential changes
@goekay goekay merged commit c9d24a9 into master Aug 24, 2024
45 checks passed
@goekay goekay deleted the refactor_datasource branch August 24, 2024 13:07
public DSLContext dslContext() {
initDataSource();

public DSLContext dslContext(DataSource dataSource) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can avoid the parameter if you get bean by calling dataSource() like in many spring samples.

@@ -52,6 +59,25 @@ public class GenericRepositoryImpl implements GenericRepository {

@Autowired private DSLContext ctx;

@EventListener
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is mixing repository and service layer.

Why not move the logic into a service and use a getMySQLOffsets() provided by the repository?

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

Successfully merging this pull request may close these issues.

2 participants