public class H2ManyToManyMain extends ManyToManyMain
NOTE: We use asserts in a couple of places to verify the results but if this were actual production code, we would have proper error handling.
CLASSYTOOLS COMMENTS:
This example shows JPA in action. The application code exempifies use of a standard persistence interface. The OrmLite implemention is mostly hidden in library code, but does show up in named queries where, to keep things lightweight, OrmLite QueryBuilder is employed in place of a JQL implementation @see ManyToManyGenerator.
Also noteable is dependency injection using Dagger @see ManyToManyModule. If one studies the details, what the dependency inject allows is flexibility in 3 ways:
POSTS_BY_USER, PU_NAME, USERS_BY_POST| Constructor and Description |
|---|
H2ManyToManyMain()
Create H2ManyToManyMain object
This creates and populates the database using JPA, provides verification logic and runs a test from main().
|
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Test ManyToMany association
|
close, getPost1, getPost2, getUser1, getUser2, setUp, verifyPostsByUser, verifyUsersByPostpublic H2ManyToManyMain()
public static void main(String[] args)
args - Not usedThis documentation is licensed by Andrew Bowley under the GPLv3 License.