Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HibernateOGMExamples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
We are moving to Forgejo!
You are on a read-only GitLab instance.
Show more breadcrumbs
Jeffrey Phillips Freeman
HibernateOGMExamples
Commits
000eee16
Commit
000eee16
authored
10 years ago
by
Jeffrey Phillips Freeman
Browse files
Options
Downloads
Patches
Plain Diff
Added an assertion to the unit test. Seems to actually be working.
parent
19df1c73
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/com/syncleus/grail/graph/hibernate/DogBreedTest.java
+3
-3
3 additions, 3 deletions
...java/com/syncleus/grail/graph/hibernate/DogBreedTest.java
with
3 additions
and
3 deletions
src/test/java/com/syncleus/grail/graph/hibernate/DogBreedTest.java
+
3
−
3
View file @
000eee16
...
@@ -2,6 +2,7 @@ package com.syncleus.grail.graph.hibernate;
...
@@ -2,6 +2,7 @@ package com.syncleus.grail.graph.hibernate;
import
com.syncleus.grail.graph.hibernate.domain.Breed
;
import
com.syncleus.grail.graph.hibernate.domain.Breed
;
import
com.syncleus.grail.graph.hibernate.domain.Dog
;
import
com.syncleus.grail.graph.hibernate.domain.Dog
;
import
junit.framework.Assert
;
import
org.hibernate.ogm.util.impl.Log
;
import
org.hibernate.ogm.util.impl.Log
;
import
org.hibernate.ogm.util.impl.LoggerFactory
;
import
org.hibernate.ogm.util.impl.LoggerFactory
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -28,7 +29,6 @@ public class DogBreedTest {
...
@@ -28,7 +29,6 @@ public class DogBreedTest {
//Persist entities the way you are used to in plain JPA
//Persist entities the way you are used to in plain JPA
try
{
try
{
tm
.
begin
();
tm
.
begin
();
// logger.infof( "About to store dog and breed" );
EntityManager
em
=
emf
.
createEntityManager
();
EntityManager
em
=
emf
.
createEntityManager
();
Breed
collie
=
new
Breed
();
Breed
collie
=
new
Breed
();
collie
.
setName
(
"Collie"
);
collie
.
setName
(
"Collie"
);
...
@@ -43,11 +43,11 @@ public class DogBreedTest {
...
@@ -43,11 +43,11 @@ public class DogBreedTest {
tm
.
commit
();
tm
.
commit
();
//Retrieve your entities the way you are used to in plain JPA
//Retrieve your entities the way you are used to in plain JPA
// logger.infof( "About to retrieve dog and breed" );
tm
.
begin
();
tm
.
begin
();
em
=
emf
.
createEntityManager
();
em
=
emf
.
createEntityManager
();
dina
=
em
.
find
(
Dog
.
class
,
dinaId
);
dina
=
em
.
find
(
Dog
.
class
,
dinaId
);
// logger.infof( "Found dog %s of breed %s", dina.getName(), dina.getBreed().getName() );
Assert
.
assertEquals
(
"Dina"
,
dina
.
getName
());
Assert
.
assertEquals
(
"Collie"
,
dina
.
getBreed
().
getName
());
em
.
flush
();
em
.
flush
();
em
.
close
();
em
.
close
();
tm
.
commit
();
tm
.
commit
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment