Skip to content

Commit 70b692c

Browse files
committed
extremely minor things
1 parent 47a7f54 commit 70b692c

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

hibernate-core/src/main/java/org/hibernate/boot/beanvalidation/TypeSafeActivator.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -418,17 +418,16 @@ private static boolean isNotNullDescriptor(ConstraintDescriptor<?> descriptor) {
418418

419419
private static void markNotNull(Property property) {
420420
// single table inheritance should not be forced to null due to shared state
421-
if ( !( property.getPersistentClass() instanceof SingleTableSubclass ) ) {
422-
// composite should not add not-null on all columns
423-
if ( !property.isComposite() ) {
424-
property.setOptional( false );
425-
for ( var selectable : property.getSelectables() ) {
426-
if ( selectable instanceof Column column ) {
427-
column.setNullable( false );
428-
}
429-
else {
430-
BEAN_VALIDATION_LOGGER.notNullOnFormulaPortion( property.getName() );
431-
}
421+
if ( !( property.getPersistentClass() instanceof SingleTableSubclass )
422+
// composite should not add not-null on all columns
423+
&& !property.isComposite() ) {
424+
property.setOptional( false );
425+
for ( var selectable : property.getSelectables() ) {
426+
if ( selectable instanceof Column column ) {
427+
column.setNullable( false );
428+
}
429+
else {
430+
BEAN_VALIDATION_LOGGER.notNullOnFormulaPortion( property.getName() );
432431
}
433432
}
434433
}

hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ protected Object performSaveOrReplicate(
292292
delayIdentityInserts
293293
);
294294

295-
// postpone initializing id in case the insert has non-nullable transient dependencies
296-
// that are not resolved until cascadeAfterSave() is executed
295+
// postpone initializing id in case the insert has non-nullable transient
296+
// dependencies that are not resolved until cascadeAfterSave() is executed
297297
cascadeAfterSave( source, persister, entity, context );
298298

299299
final Object finalId = handleGeneratedId( useIdentityColumn, id, insert );
@@ -423,7 +423,7 @@ protected boolean visitCollectionsBeforeSave(
423423
* @param persister The entity persister
424424
* @param source The originating session
425425
*
426-
* @return True if the snapshot state changed such that
426+
* @return true if the snapshot state changed such that
427427
* reinjection of the values into the entity is required.
428428
*/
429429
protected boolean substituteValuesIfNecessary(
@@ -460,7 +460,7 @@ protected void cascadeBeforeSave(
460460
EntityPersister persister,
461461
Object entity,
462462
C context) {
463-
// cascade-save to many-to-one BEFORE the parent is saved
463+
// cascade save to many-to-one BEFORE the parent is saved
464464
final var persistenceContext = source.getPersistenceContextInternal();
465465
persistenceContext.incrementCascadeLevel();
466466
try {
@@ -491,7 +491,7 @@ protected void cascadeAfterSave(
491491
EntityPersister persister,
492492
Object entity,
493493
C context) {
494-
// cascade-save to collections AFTER the collection owner was saved
494+
// cascade save to collections AFTER the collection owner was saved
495495
final var persistenceContext = source.getPersistenceContextInternal();
496496
persistenceContext.incrementCascadeLevel();
497497
try {

hibernate-core/src/main/java/org/hibernate/event/internal/DefaultDeleteEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ protected void cascadeBeforeDelete(
499499
final var persistenceContext = session.getPersistenceContextInternal();
500500
persistenceContext.incrementCascadeLevel();
501501
try {
502-
// cascade-delete to collections BEFORE the collection owner is deleted
502+
// cascade delete to collections BEFORE the collection owner is deleted
503503
Cascade.cascade(
504504
CascadingActions.REMOVE,
505505
CascadePoint.AFTER_INSERT_BEFORE_DELETE,

0 commit comments

Comments
 (0)