Best code examples for Hibernate ORM JaxbRoot class (org.hibernate.internal.jaxb.JaxbRoot)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM JaxbRoot class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM JaxbRoot examples from Open Source projects
This code example shows how to use the following methods:
        Unmarshaller unmarshaller = jc.createUnmarshaller(); 
        unmarshaller.setSchema( schema ); 
        StreamSource stream = new StreamSource( in ); 
        JAXBElement<T> elem = unmarshaller.unmarshal( stream, clazz ); 
        Origin origin = new Origin( null, fileName ); 
        return new JaxbRoot<T>( elem.getValue(), origin ); 
    } 
 
    private static Schema getMappingSchema(String schemaVersion, ClassLoaderService classLoaderService) { 
        URL schemaUrl = classLoaderService.locateResource( schemaVersion ); 
        SchemaFactory sf = SchemaFactory.newInstance( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI ); 
        Schema schema = null; 
        try { 
            schema = sf.newSchema( schemaUrl ); 
        } 
        catch ( SAXException e ) { 
            LOG.debugf( "Unable to create schema for %s: %s", schemaVersion, e.getMessage() ); 
        } 
        return schema; 
    } 
Full Snippet Info
4
CodeRank