code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public void setChildren(List<Child> children) {
this.children = children;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | setChildren | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public Integer getId() {
return id;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | getId | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public void setId(Integer id) {
this.id = id;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | setId | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public Integer getIndex1() {
return index1;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | getIndex1 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public void setIndex1(Integer index1) {
this.index1 = index1;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | setIndex1 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public Integer getIndex2() {
return index2;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | getIndex2 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public void setIndex2(Integer index2) {
this.index2 = index2;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | setIndex2 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public List<Parent> getParents() {
return parents;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | getParents | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public void setParents(List<Parent> parents) {
this.parents = parents;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | setParents | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Override
public boolean equals(Object o) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
Child child = (Child) o;
return Objects.equals( id, child.id ) &&
Objects.equals( index1, child.index1 );
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | equals | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Override
public int hashCode() {
return Objects.hash( id, index1 );
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | hashCode | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Override
public String toString() {
return "Child{" +
"id=" + id +
", index1=" + index1 +
'}';
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | toString | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class<?>[] { Parent.class, Child.class };
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | getAnnotatedClasses | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Test
public void initData() {
// Rev 1
this.parentId = doInJPA( this::entityManagerFactory, entityManager -> {
final Parent parent = new Parent();
final Child child1 = new Child();
child1.setId( 1 );
child1.setIndex1( 1 );
child1.setIndex2( 1 );
child1.getParents().add( parent );
parent.getC... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | initData | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Test
public void testRevisionCounts() {
assertEquals( Arrays.asList( 1, 2, 3, 4 ), getAuditReader().getRevisions( Parent.class, this.parentId ) );
assertEquals( Arrays.asList( 1, 4 ), getAuditReader().getRevisions( Child.class, 1 ) );
assertEquals( Arrays.asList( 1, 3 ), getAuditReader().getRevisions( Child.cla... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | testRevisionCounts | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Test
public void testRevision1History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 1 );
assertNotNull( parent );
assertTrue( !parent.getChildren().isEmpty() );
assertEquals( 2, parent.getChildren().size() );
assertEquals( Arrays.asList( new Child( 1, 1 ), new Child( 2, 2 ) )... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | testRevision1History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Test
public void testRevision2History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 2 );
assertNotNull( parent );
assertTrue( !parent.getChildren().isEmpty() );
assertEquals( 3, parent.getChildren().size() );
assertEquals( Arrays.asList( new Child( 1, 1 ), new Child( 2, 2 ), ... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | testRevision2History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Test
public void testRevision3History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 3 );
assertNotNull( parent );
assertTrue( !parent.getChildren().isEmpty() );
assertEquals( 2, parent.getChildren().size() );
assertEquals( Arrays.asList( new Child( 1, 1 ), new Child( 3, 3 ) )... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | testRevision3History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
@Test
public void testRevision4History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 4 );
assertNotNull( parent );
assertTrue( parent.getChildren().isEmpty() );
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities are audited but the association is not.
The double audited entity but no association audited mapping invokes the use
of the TwoEntityOneAuditedGenerator which we want to verify orders the
collection results properly.
@a... | testRevision4History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityOneAuditedTest.java | Apache-2.0 |
public Integer getId() {
return id;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | getId | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public void setId(Integer id) {
this.id = id;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | setId | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public List<Child> getChildren() {
return children;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | getChildren | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public void setChildren(List<Child> children) {
this.children = children;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | setChildren | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public Integer getId() {
return id;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | getId | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public void setId(Integer id) {
this.id = id;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | setId | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public Integer getIndex1() {
return index1;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | getIndex1 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public void setIndex1(Integer index1) {
this.index1 = index1;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | setIndex1 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public Integer getIndex2() {
return index2;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | getIndex2 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public void setIndex2(Integer index2) {
this.index2 = index2;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | setIndex2 | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public List<Parent> getParents() {
return parents;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | getParents | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
public void setParents(List<Parent> parents) {
this.parents = parents;
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | setParents | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Override
public boolean equals(Object o) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
Child child = (Child) o;
return Objects.equals( id, child.id ) &&
Objects.equals( index1, child.index1 );
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | equals | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Override
public int hashCode() {
return Objects.hash( id, index1 );
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | hashCode | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Override
public String toString() {
return "Child{" +
"id=" + id +
", index1=" + index1 +
'}';
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | toString | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class<?>[] { Parent.class, Child.class };
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | getAnnotatedClasses | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Test
public void initData() {
// Rev 1
this.parentId = doInJPA( this::entityManagerFactory, entityManager -> {
final Parent parent = new Parent();
final Child child1 = new Child();
child1.setId( 1 );
child1.setIndex1( 1 );
child1.setIndex2( 1 );
child1.getParents().add( parent );
parent.getC... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | initData | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Test
public void testRevisionCounts() {
assertEquals( Arrays.asList( 1, 2, 3, 4 ), getAuditReader().getRevisions( Parent.class, this.parentId ) );
assertEquals( Arrays.asList( 1, 4 ), getAuditReader().getRevisions( Child.class, 1 ) );
assertEquals( Arrays.asList( 1, 3 ), getAuditReader().getRevisions( Child.cla... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | testRevisionCounts | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Test
public void testRevision1History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 1 );
assertNotNull( parent );
assertTrue( !parent.getChildren().isEmpty() );
assertEquals( 2, parent.getChildren().size() );
assertEquals( Arrays.asList( new Child( 1, 1 ), new Child( 2, 2 ) )... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | testRevision1History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Test
public void testRevision2History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 2 );
assertNotNull( parent );
assertTrue( !parent.getChildren().isEmpty() );
assertEquals( 3, parent.getChildren().size() );
assertEquals( Arrays.asList( new Child( 1, 1 ), new Child( 2, 2 ), ... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | testRevision2History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Test
public void testRevision3History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 3 );
assertNotNull( parent );
assertTrue( !parent.getChildren().isEmpty() );
assertEquals( 2, parent.getChildren().size() );
assertEquals( Arrays.asList( new Child( 1, 1 ), new Child( 3, 3 ) )... | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | testRevision3History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Test
public void testRevision4History() {
final Parent parent = getAuditReader().find( Parent.class, this.parentId, 4 );
assertNotNull( parent );
assertTrue( parent.getChildren().isEmpty() );
} | Test the use of the {@link OrderBy} annotation on a many-to-many collection
where the two entities and the association are audited.
The double auditd entity and association mapping invokes the use of the
TwoEntityQueryGenerator which we want to verify orders the collection
results properly.
@author Chris Cranford | testRevision4History | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/query/OrderByTwoEntityTest.java | Apache-2.0 |
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class[] {ChildEntity.class, ParentEntity.class, LongRevNumberRevEntity.class};
} | A join-inheritance test using a custom revision entity where the revision number is a long, mapped in the database
as an int.
@author Adam Warski (adam at warski dot org) | getAnnotatedClasses | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java | Apache-2.0 |
@Test
public void testChildRevColumnType() {
// Hibernate now sorts columns that are part of the key and therefore this test needs to test
// for the existence of the specific key column rather than the expectation that is exists at
// a specific order.
List<Selectable> childEntityKeyColumns = metadata()
.... | A join-inheritance test using a custom revision entity where the revision number is a long, mapped in the database
as an int.
@author Adam Warski (adam at warski dot org) | testChildRevColumnType | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/reventity/LongRevEntityInheritanceChildAuditing.java | Apache-2.0 |
@Parameterized.Parameters
public static List<Object[]> data() {
return Arrays.asList(
new Object[] {null},
new Object[] {"org.hibernate.envers.strategy.ValidityAuditStrategy"}
);
} | An abstract Envers test which runs the tests using two audit strategies.
@author Adam Warski (adam at warski dot org) | data | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | Apache-2.0 |
public void setTestData(Object[] data) {
auditStrategy = (String) data[0];
} | An abstract Envers test which runs the tests using two audit strategies.
@author Adam Warski (adam at warski dot org) | setTestData | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | Apache-2.0 |
public String getAuditStrategy() {
return auditStrategy;
} | An abstract Envers test which runs the tests using two audit strategies.
@author Adam Warski (adam at warski dot org) | getAuditStrategy | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | Apache-2.0 |
protected Column getColumnFromIteratorByName(List<Selectable> selectables, String columnName) {
for ( Selectable s : selectables ) {
Column column = (Column) s;
if ( column.getName().equals( columnName) ) {
return column;
}
}
return null;
} | An abstract Envers test which runs the tests using two audit strategies.
@author Adam Warski (adam at warski dot org) | getColumnFromIteratorByName | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractEnversTest.java | Apache-2.0 |
@BeforeClassOnce
public void init() throws URISyntaxException {
config = new Configuration();
URL url = Thread.currentThread().getContextClassLoader().getResource( getHibernateConfigurationFileName() );
config.configure( new File( url.toURI() ) );
// Envers tests expect sequences to not skip values...
config... | Base class for testing envers with Session when the same session and
auditReader must be used for the hole test.
@author Hernán Chanfreau | init | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | Apache-2.0 |
protected String getHibernateConfigurationFileName() {
return "hibernate.test.session-cfg.xml";
} | Base class for testing envers with Session when the same session and
auditReader must be used for the hole test.
@author Hernán Chanfreau | getHibernateConfigurationFileName | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | Apache-2.0 |
private SessionFactory getSessionFactory() {
return sessionFactory;
} | Base class for testing envers with Session when the same session and
auditReader must be used for the hole test.
@author Hernán Chanfreau | getSessionFactory | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | Apache-2.0 |
@AfterClassOnce
public void closeSessionFactory() {
try {
sessionFactory.close();
}
finally {
if ( serviceRegistry != null ) {
ServiceRegistryBuilder.destroy( serviceRegistry );
serviceRegistry = null;
}
}
} | Base class for testing envers with Session when the same session and
auditReader must be used for the hole test.
@author Hernán Chanfreau | closeSessionFactory | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | Apache-2.0 |
@Before
public void initializeSession() {
if ( getSession() == null ) {
session = getSessionFactory().openSession();
auditReader = AuditReaderFactory.get( session );
}
} | Creates a new session and auditReader only if there is nothing created
before | initializeSession | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/AbstractOneSessionTest.java | Apache-2.0 |
@Parameterized.Parameters
public static List<Object[]> data() {
return Arrays.asList(
new Object[]{ null },
new Object[]{ "org.hibernate.envers.strategy.ValidityAuditStrategy" }
);
} | @author Strong Liu (stliu@hibernate.org) | data | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
public void setTestData(Object[] data) {
auditStrategy = (String) data[0];
} | @author Strong Liu (stliu@hibernate.org) | setTestData | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
public String getAuditStrategy() {
return auditStrategy;
} | @author Strong Liu (stliu@hibernate.org) | getAuditStrategy | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
@Override
protected Session getSession() {
Session session = super.getSession();
if ( session == null || !session.isOpen() ) {
return openSession();
}
return session;
} | @author Strong Liu (stliu@hibernate.org) | getSession | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
protected AuditReader getAuditReader() {
Session session = getSession();
if(session.getTransaction().getStatus() != TransactionStatus.ACTIVE ){
session.getTransaction().begin();
}
return AuditReaderFactory.get( getSession() );
} | @author Strong Liu (stliu@hibernate.org) | getAuditReader | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
protected Configuration getConfiguration() {
ServiceRegistry registry = getSession().unwrap(SessionImpl.class ).getSessionFactory().getServiceRegistry();
return registry.getService( EnversService.class ).getConfig();
} | @author Strong Liu (stliu@hibernate.org) | getConfiguration | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
@Override
protected void addSettings(Map<String,Object> settings) {
super.addSettings( settings );
settings.put( EnversSettings.USE_REVISION_ENTITY_WITH_NATIVE_ID, "false" );
// Envers tests expect sequences to not skip values...
settings.put( EnversSettings.REVISION_SEQUENCE_NOCACHE, "true" );
if ( getAud... | @author Strong Liu (stliu@hibernate.org) | addSettings | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
@Override
protected String getBaseForMappings() {
return "";
} | @author Strong Liu (stliu@hibernate.org) | getBaseForMappings | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversFunctionalTestCase.java | Apache-2.0 |
protected Dialect getDialect() {
return dialect;
} | @author Strong Liu (stliu@hibernate.org) | getDialect | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected EntityManagerFactory entityManagerFactory() {
return entityManagerFactory;
} | @author Strong Liu (stliu@hibernate.org) | entityManagerFactory | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected StandardServiceRegistryImpl serviceRegistry() {
return serviceRegistry;
} | @author Strong Liu (stliu@hibernate.org) | serviceRegistry | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected MetadataImplementor metadata() {
return entityManagerFactoryBuilder.getMetadata();
} | @author Strong Liu (stliu@hibernate.org) | metadata | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
@BeforeClassOnce
@SuppressWarnings("unused")
public void buildEntityManagerFactory() throws Exception {
log.trace( "Building EntityManagerFactory" );
entityManagerFactoryBuilder = (EntityManagerFactoryBuilderImpl) Bootstrap.getEntityManagerFactoryBuilder(
buildPersistenceUnitDescriptor(),
buildSettings()... | @author Strong Liu (stliu@hibernate.org) | buildEntityManagerFactory | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
private PersistenceUnitDescriptor buildPersistenceUnitDescriptor() {
return new PersistenceUnitDescriptorAdapter();
} | @author Strong Liu (stliu@hibernate.org) | buildPersistenceUnitDescriptor | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
private Map buildSettings() {
Map settings = getConfig();
addMappings( settings );
if ( createSchema() ) {
settings.put( AvailableSettings.HBM2DDL_AUTO, "create-drop" );
final String secondSchemaName = createSecondSchema();
if ( StringHelper.isNotEmpty( secondSchemaName ) ) {
if ( !(getDialect() ins... | @author Strong Liu (stliu@hibernate.org) | buildSettings | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected Map getConfig() {
Map<Object, Object> config = new HashMap<Object, Object>();
config.put( AvailableSettings.LOADED_CLASSES, Arrays.asList( getAnnotatedClasses() ) );
for ( Map.Entry<Class, String> entry : getCachedClasses().entrySet() ) {
config.put( AvailableSettings.CLASS_CACHE_PREFIX + "." + ent... | @author Strong Liu (stliu@hibernate.org) | getConfig | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
@SuppressWarnings("unchecked")
protected void addMappings(Map settings) {
String[] mappings = getMappings();
if ( mappings != null ) {
settings.put( AvailableSettings.HBM_XML_FILES, String.join( ",", mappings ) );
}
} | @author Strong Liu (stliu@hibernate.org) | addMappings | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected String[] getMappings() {
return NO_MAPPINGS;
} | @author Strong Liu (stliu@hibernate.org) | getMappings | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected Class<?>[] getAnnotatedClasses() {
return NO_CLASSES;
} | @author Strong Liu (stliu@hibernate.org) | getAnnotatedClasses | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
public Map<Class, String> getCachedClasses() {
return new HashMap<Class, String>();
} | @author Strong Liu (stliu@hibernate.org) | getCachedClasses | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
public Map<String, String> getCachedCollections() {
return new HashMap<String, String>();
} | @author Strong Liu (stliu@hibernate.org) | getCachedCollections | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
public String[] getEjb3DD() {
return new String[] {};
} | @author Strong Liu (stliu@hibernate.org) | getEjb3DD | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected boolean createSchema() {
return true;
} | @author Strong Liu (stliu@hibernate.org) | createSchema | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected String createSecondSchema() {
return null;
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | createSecondSchema | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected boolean autoRegisterListeners() {
return true;
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | autoRegisterListeners | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
@AfterClassOnce
public void releaseEntityManagerFactory() {
if ( entityManagerFactory != null && entityManagerFactory.isOpen() ) {
entityManagerFactory.close();
}
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | releaseEntityManagerFactory | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
@After
@SuppressWarnings("unused")
public void releaseUnclosedEntityManagers() {
releaseUnclosedEntityManager( this.em );
auditReader = null;
for ( EntityManager isolatedEm : isolatedEms ) {
releaseUnclosedEntityManager( isolatedEm );
}
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | releaseUnclosedEntityManagers | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
private void releaseUnclosedEntityManager(EntityManager em) {
if ( em == null ) {
return;
}
if ( !em.isOpen() ) {
em = null;
return;
}
if ( JtaStatusHelper.isActive( TestingJtaPlatformImpl.INSTANCE.getTransactionManager() ) ) {
log.warn( "Cleaning up unfinished transaction" );
try {
Testing... | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | releaseUnclosedEntityManager | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected EntityManager getEntityManager() {
return getOrCreateEntityManager();
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | getEntityManager | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected EntityManager getOrCreateEntityManager() {
if ( em == null || !em.isOpen() ) {
em = entityManagerFactory.createEntityManager();
}
return em;
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | getOrCreateEntityManager | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected AuditReader getAuditReader() {
if ( auditReader != null ) {
return auditReader;
}
return auditReader = AuditReaderFactory.get( getOrCreateEntityManager() );
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | getAuditReader | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected EntityManager createIsolatedEntityManager() {
EntityManager isolatedEm = entityManagerFactory.createEntityManager();
isolatedEms.add( isolatedEm );
return isolatedEm;
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | createIsolatedEntityManager | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected EntityManager createIsolatedEntityManager(Map props) {
EntityManager isolatedEm = entityManagerFactory.createEntityManager( props );
isolatedEms.add( isolatedEm );
return isolatedEm;
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | createIsolatedEntityManager | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
protected EntityManager createEntityManager(Map properties) {
// always reopen a new EM and close the existing one
if ( em != null && em.isOpen() ) {
em.close();
}
em = entityManagerFactory.createEntityManager( properties );
return em;
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | createEntityManager | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
public Configuration getConfiguration() {
final ServiceRegistry serviceRegistry = metadata().getMetadataBuildingOptions().getServiceRegistry();
return serviceRegistry.getService( EnversService.class ).getConfig();
} | Feature supported only by H2 dialect.
@return Provide not empty name to create second schema. | getConfiguration | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/BaseEnversJPAFunctionalTestCase.java | Apache-2.0 |
@Override
protected Object getTestInstance() throws Exception {
Object testInstance = super.getTestInstance();
if ( AbstractEnversTest.class.isInstance( testInstance ) ) {
((AbstractEnversTest) testInstance).setTestData( computeParams() );
}
else if ( BaseEnversFunctionalTestCase.class.isInstance( tes... | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | getTestInstance | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
@Override
protected Statement withBeforeClasses(Statement statement) {
if ( !isAuditStrategyAllowed( getTestClass().getAnnotation( RequiresAuditStrategy.class ) ) ) {
LOG.infof( "Required audit strategy not available, test class '%s' skipped.", getTestClass().getName() );
ignoreAllTests = true;
return ... | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | withBeforeClasses | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
if ( !isAuditStrategyAllowed( method ) ) {
if ( !ignoreAllTests ) {
LOG.infof( "Required audit strategy not available, test '%s' skipped.", method.getName() );
}
notifier.fireTestIgnored( describeChild( method ) );
... | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | runChild | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
private boolean isAuditStrategyAllowed(FrameworkMethod method) {
return isAuditStrategyAllowed( Helper.locateAnnotation( RequiresAuditStrategy.class, method, getTestClass() ) );
} | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | isAuditStrategyAllowed | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
private boolean isAuditStrategyAllowed(RequiresAuditStrategy auditStrategyAnn) {
if ( auditStrategyAnn == null ) {
// if there is no annotation, then execution is permissible
return true;
}
// if an annotation exists, verify its allowed
final String strategyNameInUse = getStrategyClassSimpleName();... | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | isAuditStrategyAllowed | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
private Object[] computeParams() throws Exception {
try {
return fParameterList.get( fParameterSetNumber );
}
catch (ClassCastException e) {
throw new Exception(
String.format(
"%s.%s() must return a Collection of arrays.",
getTestClass().getName(), getParametersMethod(
ge... | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | computeParams | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
@Override
protected String getName() {
return String.format( "[%s]", fParameterSetNumber );
} | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | getName | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
@Override
protected String testName(final FrameworkMethod method) {
return String.format(
"%s[%s]", method.getName(),
fParameterSetNumber
);
} | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | testName | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
private String getStrategyClassSimpleName() {
Object name = fParameterList.get( fParameterSetNumber )[ 0 ];
if ( name != null ) {
String strategyName = (String) name;
name = strategyName.substring( strategyName.lastIndexOf( "." ) + 1 );
}
return ( name != null ? name.toString() : DefaultAuditStrateg... | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | getStrategyClassSimpleName | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
@Override
protected void sortMethods(List<FrameworkMethod> computedTestMethods) {
super.sortMethods( computedTestMethods );
Collections.sort(
computedTestMethods, new Comparator<FrameworkMethod>() {
private int getPriority(FrameworkMethod fm) {
Priority p = fm.getAnnotation( Priority.class );
... | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | sortMethods | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
private int getPriority(FrameworkMethod fm) {
Priority p = fm.getAnnotation( Priority.class );
return p == null ? 0 : p.value();
} | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | getPriority | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
@Override
public int compare(FrameworkMethod fm1, FrameworkMethod fm2) {
return getPriority( fm2 ) - getPriority( fm1 );
} | Copied & modified from {@link Parameterized}.
<p>
The modification is that the generated runners extend {@link CustomRunner} instead of the default
{@code TestClassRunnerForParameters}.
<p>
The runner itself sets the data using a setter instead of a constructor, and creates only one test instance. Moreover
it doesn't o... | compare | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
@Override
protected List<Runner> getChildren() {
return runners;
} | Only called reflectively. Do not use programmatically. | getChildren | java | hibernate/hibernate-orm | hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/EnversRunner.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.