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;
}
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;
}
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);
}
}
Aggregations