Search in sources :

Example 6 with JaxbEntityMappings

use of org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappings in project hibernate-orm by hibernate.

the class Ejb3XmlTestCase method getContext.

protected XMLContext getContext(InputStream is, String resourceName) throws Exception {
    XMLMappingHelper xmlHelper = new XMLMappingHelper();
    JaxbEntityMappings mappings = xmlHelper.readOrmXmlMappings(is, resourceName);
    XMLContext context = new XMLContext(bootstrapContext);
    context.addDocument(mappings);
    return context;
}
Also used : JaxbEntityMappings(org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappings) XMLMappingHelper(org.hibernate.orm.test.internal.util.xml.XMLMappingHelper) XMLContext(org.hibernate.cfg.annotations.reflection.internal.XMLContext)

Example 7 with JaxbEntityMappings

use of org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappings in project hibernate-orm by hibernate.

the class JPAXMLOverriddenAnnotationReaderTest method buildContext.

private XMLContext buildContext(String ormfile) throws IOException {
    XMLMappingHelper xmlHelper = new XMLMappingHelper();
    JaxbEntityMappings mappings = xmlHelper.readOrmXmlMappings(ormfile);
    XMLContext context = new XMLContext(bootstrapContext);
    context.addDocument(mappings);
    return context;
}
Also used : JaxbEntityMappings(org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappings) XMLMappingHelper(org.hibernate.orm.test.internal.util.xml.XMLMappingHelper) XMLContext(org.hibernate.cfg.annotations.reflection.internal.XMLContext)

Example 8 with JaxbEntityMappings

use of org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappings in project quarkus by quarkusio.

the class RecordableXmlMapping method create.

public static RecordableXmlMapping create(Binding<?> binding) {
    Object root = binding.getRoot();
    Origin origin = binding.getOrigin();
    if (root instanceof JaxbEntityMappings) {
        return new RecordableXmlMapping((JaxbEntityMappings) root, null, origin.getType(), origin.getName());
    } else if (root instanceof JaxbHbmHibernateMapping) {
        return new RecordableXmlMapping(null, (JaxbHbmHibernateMapping) root, origin.getType(), origin.getName());
    } else {
        throw new IllegalArgumentException("Unsupported mapping file root (unrecognized type): " + root);
    }
}
Also used : Origin(org.hibernate.boot.jaxb.Origin) JaxbEntityMappings(org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappings) JaxbHbmHibernateMapping(org.hibernate.boot.jaxb.hbm.spi.JaxbHbmHibernateMapping)

Aggregations

JaxbEntityMappings (org.hibernate.boot.jaxb.mapping.spi.JaxbEntityMappings)8 Origin (org.hibernate.boot.jaxb.Origin)3 XMLContext (org.hibernate.cfg.annotations.reflection.internal.XMLContext)3 XMLMappingHelper (org.hibernate.orm.test.internal.util.xml.XMLMappingHelper)3 JaxbHbmHibernateMapping (org.hibernate.boot.jaxb.hbm.spi.JaxbHbmHibernateMapping)2 Test (org.junit.jupiter.api.Test)2 NamedNativeQuery (jakarta.persistence.NamedNativeQuery)1 NamedQuery (jakarta.persistence.NamedQuery)1 NamedStoredProcedureQuery (jakarta.persistence.NamedStoredProcedureQuery)1 SequenceGenerator (jakarta.persistence.SequenceGenerator)1 SqlResultSetMapping (jakarta.persistence.SqlResultSetMapping)1 TableGenerator (jakarta.persistence.TableGenerator)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 XMLEventReader (javax.xml.stream.XMLEventReader)1 StreamSource (javax.xml.transform.stream.StreamSource)1 UnsupportedOrmXsdVersionException (org.hibernate.boot.UnsupportedOrmXsdVersionException)1 MappingBinder (org.hibernate.boot.jaxb.internal.MappingBinder)1