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

Possible renaming of "myEntityManagerFactory"? #167

Closed
mojitoholic opened this Issue Apr 23, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@mojitoholic
Contributor

mojitoholic commented Apr 23, 2015

This is a possible minor configuration improvement.
While trying to add some entities to the database using the existing EntityManagerFactory, I noticed that renaming the object to entityManagerFactory will better fit autowiring of JPA Repositories if one wants to define new entities.
I renamed this manually in the config file and things went well but I thought it might be a good idea to rename this in the main branch.

@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Apr 24, 2015

I'm not sure I understand the benefit. All of the spring beans that ship with hapi-fhir-jpaserver-base use the naming convention of "my[Foo]", so I think if we change entityManagerFactory, we'd want to change everything else. I mean, I'm not in any way attached to the myFoo naming style (I'm not even sure why I did them that way to be honest) but I feel like that's a pretty sweeping change..

@mojitoholic

This comment has been minimized.

Contributor

mojitoholic commented Apr 24, 2015

I understand. Like I said this is not a big deal really since one can easily change the names.
The issue is when you use @repository for a class, you can autowire the corresponding JpaRepository --which results in a much cleaner code-- and that will trigger spring to look for a bean named "entityManagerFactory".
This might be configurable in Spring but the default behavior is as such.

@jamesagnew

This comment has been minimized.

Owner

jamesagnew commented Apr 30, 2015

This seems reasonable enough. I'll make the switch now.

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