Package org.hibernate.internal.jaxb

Examples of org.hibernate.internal.jaxb.Origin


   * @param document The DOM document
   *
   * @return this (for method chaining purposes)
   */
  public MetadataSources addDocument(Document document) {
    final Origin origin = new Origin( SourceType.DOM, "<unknown>" );
    JaxbRoot jaxbRoot = jaxbHelper.unmarshal( document, origin );
    jaxbRootList.add( jaxbRoot );
    return this;
  }
View Full Code Here


   *
   * @return this (for method chaining purposes)
   */
  public MetadataSources addJar(File jar) {
    LOG.debugf( "Seeking mapping documents in jar file : %s", jar.getName() );
    final Origin origin = new Origin( SourceType.JAR, jar.getAbsolutePath() );
    try {
      JarFile jarFile = new JarFile( jar );
      try {
        Enumeration jarEntries = jarFile.entries();
        while ( jarEntries.hasMoreElements() ) {
View Full Code Here

  public JaxbHibernateConfiguration loadConfigXmlResource(String cfgXmlResourceName) {
    final InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( cfgXmlResourceName );
    if ( stream == null ) {
      throw new ConfigurationException( "Could not locate cfg.xml resource [" + cfgXmlResourceName + "]" );
    }
    return jaxbProcessorHolder.getValue().unmarshal( stream, new Origin( SourceType.RESOURCE, cfgXmlResourceName ) );
  }
View Full Code Here

  @SuppressWarnings( {"unchecked"})
  public ServiceRegistryBuilder configure(String resourceName) {
    InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( resourceName );
    JaxbHibernateConfiguration configurationElement = jaxbProcessorHolder.getValue().unmarshal(
        stream,
        new Origin( SourceType.RESOURCE, resourceName )
    );
    for ( JaxbHibernateConfiguration.JaxbSessionFactory.JaxbProperty xmlProperty : configurationElement.getSessionFactory().getProperty() ) {
      settings.put( xmlProperty.getName(), xmlProperty.getValue() );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.internal.jaxb.Origin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.