Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SchemaGenScriptsTest updated to take lazy init providers into account
- Loading branch information
1 parent
50dc59d
commit a570b3a
Showing
5 changed files
with
53 additions
and
44 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
...enerate/src/main/java/org/javaee7/jpasamples/schema/gen/scripts/generate/StartupBean.java
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,23 @@ | ||
package org.javaee7.jpasamples.schema.gen.scripts.generate; | ||
|
||
import javax.annotation.PostConstruct; | ||
import javax.ejb.Singleton; | ||
import javax.ejb.Startup; | ||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
|
||
@Singleton | ||
@Startup | ||
public class StartupBean { | ||
|
||
// Some provider like EclipseLink on Payara initialize JPA more lazily | ||
// and need this to be able to spring into action and generate the scripts | ||
@PersistenceContext | ||
private EntityManager entityManager; | ||
|
||
@PostConstruct | ||
public void init() { | ||
System.out.println("Hello, world"); | ||
} | ||
|
||
} |
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