|
Hibernate example source code file (ComponentAttributeSourceImpl.java)
The Hibernate ComponentAttributeSourceImpl.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.entity; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.Value; import org.hibernate.mapping.PropertyGeneration; import org.hibernate.metamodel.source.LocalBindingContext; import org.hibernate.metamodel.source.annotations.attribute.AssociationAttribute; import org.hibernate.metamodel.source.annotations.attribute.AttributeOverride; import org.hibernate.metamodel.source.annotations.attribute.BasicAttribute; import org.hibernate.metamodel.source.annotations.attribute.SingularAttributeSourceImpl; import org.hibernate.metamodel.source.annotations.attribute.ToOneAttributeSourceImpl; import org.hibernate.metamodel.source.binder.AttributeSource; import org.hibernate.metamodel.source.binder.ComponentAttributeSource; import org.hibernate.metamodel.source.binder.ExplicitHibernateTypeSource; import org.hibernate.metamodel.source.binder.MetaAttributeSource; import org.hibernate.metamodel.source.binder.RelationalValueSource; import org.hibernate.metamodel.source.binder.SingularAttributeNature; /** * Annotation backed implementation of {@code ComponentAttributeSource}. * * @author Steve Ebersole * @author Hardy Ferentschik */ public class ComponentAttributeSourceImpl implements ComponentAttributeSource { private static final String PATH_SEPERATOR = "."; private final EmbeddableClass embeddableClass; private final Value<Class classReference; private final Map<String, AttributeOverride> attributeOverrides; private final String path; public ComponentAttributeSourceImpl(EmbeddableClass embeddableClass, String parentPath, Map<String, AttributeOverride> attributeOverrides) { this.embeddableClass = embeddableClass; this.classReference = new Value<Class( embeddableClass.getConfiguredClass() ); this.attributeOverrides = attributeOverrides; if ( StringHelper.isEmpty( parentPath ) ) { path = embeddableClass.getEmbeddedAttributeName(); } else { path = parentPath + "." + embeddableClass.getEmbeddedAttributeName(); } } @Override public boolean isVirtualAttribute() { return false; } @Override public SingularAttributeNature getNature() { return SingularAttributeNature.COMPONENT; } @Override public boolean isSingular() { return true; } @Override public String getClassName() { return embeddableClass.getConfiguredClass().getName(); } @Override public Value<Class getClassReference() { return classReference; } @Override public String getName() { return embeddableClass.getEmbeddedAttributeName(); } @Override public String getExplicitTuplizerClassName() { return embeddableClass.getCustomTuplizer(); } @Override public String getPropertyAccessorName() { return embeddableClass.getClassAccessType().toString().toLowerCase(); } @Override public LocalBindingContext getLocalBindingContext() { return embeddableClass.getLocalBindingContext(); } @Override public Iterable<AttributeSource> attributeSources() { List<AttributeSource> attributeList = new ArrayList Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate ComponentAttributeSourceImpl.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.