Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Unfinished Commits, Guice Injection Error (See persistence.xml)
Implemented DatabaseModule() for when creating the Guice injector instance. Added Guice annotations to GenericJpaDao
- Loading branch information
1 parent
480e129
commit 69b98ee
Showing
15 changed files
with
442 additions
and
1,146 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package org.mdev.revolution.database; | ||
|
|
||
| import com.google.inject.AbstractModule; | ||
| import com.google.inject.Singleton; | ||
| import com.google.inject.persist.PersistService; | ||
| import com.google.inject.persist.jpa.JpaPersistModule; | ||
|
|
||
| import javax.inject.Inject; | ||
|
|
||
| public class DatabaseModule extends AbstractModule { | ||
| public static final DatabaseModule INSTANCE = new DatabaseModule(); | ||
|
|
||
| @Override | ||
| protected void configure() { | ||
| install(new JpaPersistModule("org.mdev.revolution.jpa")); | ||
| bind(JPAInitializer.class).asEagerSingleton(); | ||
| } | ||
|
|
||
| @Singleton | ||
| public static class JPAInitializer { | ||
|
|
||
| @Inject | ||
| public JPAInitializer(final PersistService service) { | ||
| service.start(); | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters