diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/ConstraintModeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/ConstraintModeMarshalling.java new file mode 100644 index 0000000000..48049d56a7 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/ConstraintModeMarshalling.java @@ -0,0 +1,24 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.boot.jaxb.mapping.internal; + +import javax.persistence.ConstraintMode; + +/** + * Marshalling support for dealing with JPA ConstraintMode enums. Plugged into JAXB for binding + * + * @author Steve Ebersole + */ +public class ConstraintModeMarshalling { + public static ConstraintMode fromXml(String name) { + return ConstraintMode.valueOf( name ); + } + + public static String toXml(ConstraintMode accessType) { + return accessType.name(); + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/GenerationTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/GenerationTypeMarshalling.java new file mode 100644 index 0000000000..04e815d939 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/GenerationTypeMarshalling.java @@ -0,0 +1,24 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.boot.jaxb.mapping.internal; + +import javax.persistence.GenerationType; + +/** + * Marshalling support for dealing with JPA GenerationType enums. Plugged into JAXB for binding + * + * @author Steve Ebersole + */ +public class GenerationTypeMarshalling { + public static GenerationType fromXml(String name) { + return GenerationType.valueOf( name ); + } + + public static String toXml(GenerationType accessType) { + return accessType.name(); + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/InheritanceTypeMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/InheritanceTypeMarshalling.java new file mode 100644 index 0000000000..93668921b7 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/internal/InheritanceTypeMarshalling.java @@ -0,0 +1,24 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.boot.jaxb.mapping.internal; + +import javax.persistence.InheritanceType; + +/** + * Marshalling support for dealing with JPA InheritanceType enums. Plugged into JAXB for binding + * + * @author Steve Ebersole + */ +public class InheritanceTypeMarshalling { + public static InheritanceType fromXml(String name) { + return InheritanceType.valueOf( name ); + } + + public static String toXml(InheritanceType accessType) { + return accessType.name(); + } +} diff --git a/hibernate-core/src/main/xjb/mapping-bindings.xjb b/hibernate-core/src/main/xjb/mapping-bindings.xjb index 5bd32a4914..707a76e668 100644 --- a/hibernate-core/src/main/xjb/mapping-bindings.xjb +++ b/hibernate-core/src/main/xjb/mapping-bindings.xjb @@ -59,6 +59,24 @@ printMethod="org.hibernate.boot.jaxb.mapping.internal.TemporalTypeMarshalling.toXml" /> + + + + + + + + + + + + org.hibernate.boot.jaxb.mapping.spi.SchemaAware