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

New Feature: Implement withIoC={CDI, CDI_SINGLETON} options #137

Closed
Musikolo opened this Issue Jan 5, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@Musikolo

Musikolo commented Jan 5, 2017

Hi,

I think it would be very useful to have support for Java CDI standard injection mechanism based on javax.inject.Inject annotation. Additionally, it would be great to have the ability to create singletons based on javax.inject.Singleton annotation too. My proposal is to incorporate to the Selma's @Mapper annotation the follow options for the existing withIoC attribute :

  • CDI: This would add the javax.inject.Named annotation to the generated mapper class.
  • CDI_SINGLETON: This would add the javax.inject.Named and javax.inject.Singleton annotations to the generated mapper class.

The result would be that later on that we would be able to do the following in our code:

@Inject
private final UserMapper userMapper;

I've found this implementation to incorporate CDI to Selma, but I don't think it's compatible with the aforementioned request.

Thank you!

@slemesle

This comment has been minimized.

Show comment
Hide comment
@slemesle

slemesle Jan 6, 2017

Hi,

this is possible you can simply modify the implementation found to do it and add the support for withIoCServiceName parameter inside the code for CDI support.

I would be pleased to merge such a pull request with the corresponding tests.

slemesle commented Jan 6, 2017

Hi,

this is possible you can simply modify the implementation found to do it and add the support for withIoCServiceName parameter inside the code for CDI support.

I would be pleased to merge such a pull request with the corresponding tests.

@slemesle

This comment has been minimized.

Show comment
Hide comment
@slemesle

slemesle Jan 23, 2017

may I close this issue now ?

slemesle commented Jan 23, 2017

may I close this issue now ?

@Musikolo

This comment has been minimized.

Show comment
Hide comment
@Musikolo

Musikolo Jan 24, 2017

Yes, I think so. I'll take care of it! :-)

Musikolo commented Jan 24, 2017

Yes, I think so. I'll take care of it! :-)

@Musikolo Musikolo closed this Jan 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment