diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/AccessTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/AccessTypeMarshalling.java index 21a93bab80..958c333479 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/AccessTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/AccessTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.AccessType; */ public class AccessTypeMarshalling { public static AccessType fromXml(String name) { - return AccessType.valueOf( name ); + return name == null ? null : AccessType.valueOf( name ); } public static String toXml(AccessType accessType) { - return accessType.name(); + return accessType == null ? null : accessType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheAccessTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheAccessTypeMarshalling.java index 1327781107..62f81714ed 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheAccessTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheAccessTypeMarshalling.java @@ -16,10 +16,10 @@ import org.hibernate.cache.spi.access.AccessType; */ public class CacheAccessTypeMarshalling { public static AccessType fromXml(String name) { - return AccessType.fromExternalName( name ); + return name == null ? null : AccessType.fromExternalName( name ); } public static String toXml(AccessType accessType) { - return accessType.name(); + return accessType == null ? null : accessType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheModeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheModeMarshalling.java index c48e2a4589..5f37936ab3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheModeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CacheModeMarshalling.java @@ -26,6 +26,6 @@ public class CacheModeMarshalling { } public static String toXml(CacheMode cacheMode) { - return cacheMode.name().toLowerCase( Locale.ENGLISH ); + return cacheMode == null ? null : cacheMode.name().toLowerCase( Locale.ENGLISH ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CollectionClassificationMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CollectionClassificationMarshalling.java index ecf25b7c49..42402df49f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CollectionClassificationMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CollectionClassificationMarshalling.java @@ -15,10 +15,10 @@ import org.hibernate.metamodel.CollectionClassification; */ public class CollectionClassificationMarshalling { public static CollectionClassification fromXml(String name) { - return CollectionClassification.interpretSetting( name.replace( '-', '_' ) ); + return name == null ? null : CollectionClassification.interpretSetting( name.replace( '-', '_' ) ); } public static String toXml(CollectionClassification classification) { - return classification.name().replace( '_', '-' ); + return classification == null ? null : classification.name().replace( '_', '-' ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ConstraintModeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ConstraintModeMarshalling.java index d6830a8351..b8bf1c2fd4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ConstraintModeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ConstraintModeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.ConstraintMode; */ public class ConstraintModeMarshalling { public static ConstraintMode fromXml(String name) { - return ConstraintMode.valueOf( name ); + return name == null ? null : ConstraintMode.valueOf( name ); } - public static String toXml(ConstraintMode accessType) { - return accessType.name(); + public static String toXml(ConstraintMode constraintMode) { + return constraintMode == null ? null : constraintMode.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/DiscriminatorTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/DiscriminatorTypeMarshalling.java index cecce8faf9..235ecbdd71 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/DiscriminatorTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/DiscriminatorTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.DiscriminatorType; */ public class DiscriminatorTypeMarshalling { public static DiscriminatorType fromXml(String name) { - return DiscriminatorType.valueOf( name ); + return name == null ? null : DiscriminatorType.valueOf( name ); } public static String toXml(DiscriminatorType discriminatorType) { - return discriminatorType.name(); + return discriminatorType == null ? null : discriminatorType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/EnumTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/EnumTypeMarshalling.java index 4abd0232e1..1844b84006 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/EnumTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/EnumTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.EnumType; */ public class EnumTypeMarshalling { public static EnumType fromXml(String name) { - return EnumType.valueOf( name ); + return name == null ? null : EnumType.valueOf( name ); } public static String toXml(EnumType enumType) { - return enumType.name(); + return enumType == null ? null : enumType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/FetchTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/FetchTypeMarshalling.java index 282ae23550..3ccceb0d3d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/FetchTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/FetchTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.FetchType; */ public class FetchTypeMarshalling { public static FetchType fromXml(String name) { - return FetchType.valueOf( name ); + return name == null ? null : FetchType.valueOf( name ); } public static String toXml(FetchType fetchType) { - return fetchType.name(); + return fetchType == null ? null : fetchType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTimingMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTimingMarshalling.java index 92a1c4865f..fb610e2b25 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTimingMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTimingMarshalling.java @@ -17,7 +17,7 @@ import org.hibernate.tuple.GenerationTiming; */ public class GenerationTimingMarshalling { public static GenerationTiming fromXml(String name) { - return GenerationTiming.parseFromName( name ); + return name == null ? null : GenerationTiming.parseFromName( name ); } public static String toXml(GenerationTiming generationTiming) { diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTypeMarshalling.java index 4a29d0e020..beff39cf91 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/GenerationTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.GenerationType; */ public class GenerationTypeMarshalling { public static GenerationType fromXml(String name) { - return GenerationType.valueOf( name ); + return name == null ? null : GenerationType.valueOf( name ); } - public static String toXml(GenerationType accessType) { - return accessType.name(); + public static String toXml(GenerationType generationType) { + return generationType == null ? null : generationType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/InheritanceTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/InheritanceTypeMarshalling.java index 5c12443337..b19224d52f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/InheritanceTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/InheritanceTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.InheritanceType; */ public class InheritanceTypeMarshalling { public static InheritanceType fromXml(String name) { - return InheritanceType.valueOf( name ); + return name == null ? null : InheritanceType.valueOf( name ); } - public static String toXml(InheritanceType accessType) { - return accessType.name(); + public static String toXml(InheritanceType inheritanceType) { + return inheritanceType == null ? null : inheritanceType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/LockModeTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/LockModeTypeMarshalling.java index 35fcae534a..4ceb3fbe8c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/LockModeTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/LockModeTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.LockModeType; */ public class LockModeTypeMarshalling { public static LockModeType fromXml(String name) { - return LockModeType.valueOf( name ); + return name == null ? null : LockModeType.valueOf( name ); } public static String toXml(LockModeType lockModeType) { - return lockModeType.name(); + return lockModeType == null ? null : lockModeType.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OnDeleteActionMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OnDeleteActionMarshalling.java index 8e2806f659..e2b17096e1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OnDeleteActionMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OnDeleteActionMarshalling.java @@ -13,10 +13,10 @@ import org.hibernate.annotations.OnDeleteAction; */ public class OnDeleteActionMarshalling { public static OnDeleteAction fromXml(String name) { - return OnDeleteAction.fromExternalForm( name ); + return name == null ? null : OnDeleteAction.fromExternalForm( name ); } public static String toXml(OnDeleteAction accessType) { - return accessType.getAlternativeName(); + return accessType == null ? null : accessType.getAlternativeName(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OptimisticLockStyleMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OptimisticLockStyleMarshalling.java index 2a8f0cde2b..6fb78639cb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OptimisticLockStyleMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/OptimisticLockStyleMarshalling.java @@ -17,7 +17,7 @@ import org.hibernate.engine.OptimisticLockStyle; */ public class OptimisticLockStyleMarshalling { public static OptimisticLockStyle fromXml(String name) { - return OptimisticLockStyle.valueOf( name == null ? null : name.toUpperCase( Locale.ENGLISH ) ); + return name == null ? null : OptimisticLockStyle.valueOf( name.toUpperCase( Locale.ENGLISH ) ); } public static String toXml(OptimisticLockStyle lockMode) { diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ParameterModeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ParameterModeMarshalling.java index 2e115756b9..637fbbf4ae 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ParameterModeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ParameterModeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.ParameterMode; */ public class ParameterModeMarshalling { public static ParameterMode fromXml(String name) { - return ParameterMode.valueOf( name ); + return name == null ? null : ParameterMode.valueOf( name ); } public static String toXml(ParameterMode parameterMode) { - return parameterMode.name(); + return parameterMode == null ? null : parameterMode.name(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/PolymorphismTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/PolymorphismTypeMarshalling.java index 35883f737b..9fb779853a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/PolymorphismTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/PolymorphismTypeMarshalling.java @@ -13,10 +13,10 @@ import org.hibernate.annotations.PolymorphismType; */ public class PolymorphismTypeMarshalling { public static PolymorphismType fromXml(String value) { - return PolymorphismType.fromExternalValue( value ); + return value == null ? null : PolymorphismType.fromExternalValue( value ); } public static String toXml(PolymorphismType value) { - return value.getExternalForm(); + return value == null ? null : value.getExternalForm(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ResultCheckStyleMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ResultCheckStyleMarshalling.java index 55526424b8..acb39648fe 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ResultCheckStyleMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/ResultCheckStyleMarshalling.java @@ -15,10 +15,10 @@ import org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle; */ public class ResultCheckStyleMarshalling { public static ExecuteUpdateResultCheckStyle fromXml(String name) { - return ExecuteUpdateResultCheckStyle.fromExternalName( name ); + return name == null ? null : ExecuteUpdateResultCheckStyle.fromExternalName( name ); } public static String toXml(ExecuteUpdateResultCheckStyle style) { - return style.externalName(); + return style == null ? null : style.externalName(); } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/TemporalTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/TemporalTypeMarshalling.java index 77ad2fc8b9..7a326b00a4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/TemporalTypeMarshalling.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/TemporalTypeMarshalling.java @@ -15,10 +15,10 @@ import jakarta.persistence.TemporalType; */ public class TemporalTypeMarshalling { public static TemporalType fromXml(String name) { - return TemporalType.valueOf( name ); + return name == null ? null : TemporalType.valueOf( name ); } public static String toXml(TemporalType temporalType) { - return temporalType.name(); + return temporalType == null ? null : temporalType.name(); } }