HHH-6615 Minor format changes
This commit is contained in:
parent
ea170f4dca
commit
c02a703b17
|
@ -65,10 +65,8 @@ public class DefaultRevisionInfoGenerator implements RevisionInfoGenerator {
|
||||||
@Override
|
@Override
|
||||||
public void saveRevisionData(Session session, Object revisionData) {
|
public void saveRevisionData(Session session, Object revisionData) {
|
||||||
session.save( revisionInfoEntityName, revisionData );
|
session.save( revisionInfoEntityName, revisionData );
|
||||||
if ( revisionInfoNumberReader != null ) {
|
if ( revisionInfoNumberReader != null && revisionInfoNumberReader.getRevisionNumber( revisionData ).longValue() < 0 ) {
|
||||||
if ( revisionInfoNumberReader.getRevisionNumber( revisionData ).longValue() < 0 ) {
|
throw new AuditException( "Negative revision numbers are not allowed" );
|
||||||
throw new AuditException( "Negative revision numbers are not allowed" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sessionCacheCleaner.scheduleAuditDataRemoval( session, revisionData );
|
sessionCacheCleaner.scheduleAuditDataRemoval( session, revisionData );
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class RevisionNumberOverflowTest extends BaseEnversJPAFunctionalTestCase
|
||||||
root = root.getCause();
|
root = root.getCause();
|
||||||
}
|
}
|
||||||
assertTyping( type, root );
|
assertTyping( type, root );
|
||||||
assertEquals( root.getMessage(), message );
|
assertEquals( message, root.getMessage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// We create a custom revision entity here with an explicit configuration for the revision
|
// We create a custom revision entity here with an explicit configuration for the revision
|
||||||
|
@ -102,10 +102,10 @@ public class RevisionNumberOverflowTest extends BaseEnversJPAFunctionalTestCase
|
||||||
@GenericGenerator(name = "EnversCappedRevisionNumberGenerator",
|
@GenericGenerator(name = "EnversCappedRevisionNumberGenerator",
|
||||||
strategy = "org.hibernate.id.enhanced.TableGenerator",
|
strategy = "org.hibernate.id.enhanced.TableGenerator",
|
||||||
parameters = {
|
parameters = {
|
||||||
@Parameter(name = TableGenerator.TABLE_PARAM, value = "REVISION_GENERATOR"),
|
@Parameter(name = TableGenerator.TABLE_PARAM, value = "REVISION_GENERATOR"),
|
||||||
@Parameter(name = TableGenerator.INITIAL_PARAM, value = "2147483647"),
|
@Parameter(name = TableGenerator.INITIAL_PARAM, value = "2147483647"),
|
||||||
@Parameter(name = TableGenerator.INCREMENT_PARAM, value = "1"),
|
@Parameter(name = TableGenerator.INCREMENT_PARAM, value = "1"),
|
||||||
@Parameter(name = TableGenerator.CONFIG_PREFER_SEGMENT_PER_ENTITY, value = "true")
|
@Parameter(name = TableGenerator.CONFIG_PREFER_SEGMENT_PER_ENTITY, value = "true")
|
||||||
})
|
})
|
||||||
@RevisionEntity
|
@RevisionEntity
|
||||||
public static class CustomCappedRevEntity {
|
public static class CustomCappedRevEntity {
|
||||||
|
|
Loading…
Reference in New Issue