|
Hibernate example source code file (AnnotationMetadataSourceProcessorImpl.java)
The Hibernate AnnotationMetadataSourceProcessorImpl.java source code/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2011, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.metamodel.source.annotations; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.jboss.jandex.Index; import org.jboss.jandex.Indexer; import org.jboss.logging.Logger; import org.hibernate.AssertionFailure; import org.hibernate.HibernateException; import org.hibernate.metamodel.MetadataSources; import org.hibernate.metamodel.source.MetadataImplementor; import org.hibernate.metamodel.source.MetadataSourceProcessor; import org.hibernate.metamodel.source.annotation.jaxb.XMLEntityMappings; import org.hibernate.metamodel.source.annotations.global.FetchProfileBinder; import org.hibernate.metamodel.source.annotations.global.FilterDefBinder; import org.hibernate.metamodel.source.annotations.global.IdGeneratorBinder; import org.hibernate.metamodel.source.annotations.global.QueryBinder; import org.hibernate.metamodel.source.annotations.global.TableBinder; import org.hibernate.metamodel.source.annotations.global.TypeDefBinder; import org.hibernate.metamodel.source.annotations.xml.PseudoJpaDotNames; import org.hibernate.metamodel.source.annotations.xml.mocker.EntityMappingsMocker; import org.hibernate.metamodel.source.binder.Binder; import org.hibernate.metamodel.source.binder.EntityHierarchy; import org.hibernate.metamodel.source.internal.JaxbRoot; import org.hibernate.metamodel.source.internal.MetadataImpl; import org.hibernate.service.classloading.spi.ClassLoaderService; /** * Main class responsible to creating and binding the Hibernate meta-model from annotations. * This binder only has to deal with the (jandex) annotation index/repository. XML configuration is already processed * and pseudo annotations are created. * * @author Hardy Ferentschik * @author Steve Ebersole */ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProcessor { private static final Logger LOG = Logger.getLogger( AnnotationMetadataSourceProcessorImpl.class ); private final MetadataImplementor metadata; private AnnotationBindingContext bindingContext; public AnnotationMetadataSourceProcessorImpl(MetadataImpl metadata) { this.metadata = metadata; } @Override @SuppressWarnings( { "unchecked" }) public void prepare(MetadataSources sources) { // create a jandex index from the annotated classes Indexer indexer = new Indexer(); for ( Class<?> clazz : sources.getAnnotatedClasses() ) { indexClass( indexer, clazz.getName().replace( '.', '/' ) + ".class" ); } // add package-info from the configured packages for ( String packageName : sources.getAnnotatedPackages() ) { indexClass( indexer, packageName.replace( '.', '/' ) + "/package-info.class" ); } Index index = indexer.complete(); List<JaxbRoot Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate AnnotationMetadataSourceProcessorImpl.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.