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

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

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

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

Musikolo opened this issue Jan 5, 2017 · 3 comments
Milestone

Comments

@Musikolo
Copy link

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
Copy link

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.

Musikolo added a commit to Musikolo/selma that referenced this issue Jan 18, 2017
slemesle added a commit that referenced this issue Jan 23, 2017
New Feature  #137: Implement withIoC={CDI, CDI_SINGLETON} options
@slemesle slemesle added this to the 1.0 Final milestone Jan 23, 2017
@slemesle
Copy link

may I close this issue now ?

@Musikolo
Copy link
Author

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

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

No branches or pull requests

2 participants