• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Component类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.hibernate.mapping.Component的典型用法代码示例。如果您正苦于以下问题:Java Component类的具体用法?Java Component怎么用?Java Component使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Component类属于org.hibernate.mapping包,在下文中一共展示了Component类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: bindComposite

import org.hibernate.mapping.Component; //导入依赖的package包/类
public static void bindComposite(Element node, Component component, String path,
		boolean isNullable, Mappings mappings, java.util.Map inheritedMetas)
		throws MappingException {
	bindComponent(
			node,
			component,
			null,
			null,
			path,
			isNullable,
			false,
			mappings,
			inheritedMetas,
			false
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:HbmBinder.java


示例2: addProperty

import org.hibernate.mapping.Component; //导入依赖的package包/类
public void addProperty(Property prop, XClass declaringClass) {
	if ( prop.getValue() instanceof Component ) {
		//TODO handle quote and non quote table comparison
		String tableName = prop.getValue().getTable().getName();
		if ( getJoinsPerRealTableName().containsKey( tableName ) ) {
			final Join join = getJoinsPerRealTableName().get( tableName );
			addPropertyToJoin( prop, declaringClass, join );
		}
		else {
			addPropertyToPersistentClass( prop, declaringClass );
		}
	}
	else {
		addPropertyToPersistentClass( prop, declaringClass );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:ClassPropertyHolder.java


示例3: ComponentPropertyHolder

import org.hibernate.mapping.Component; //导入依赖的package包/类
public ComponentPropertyHolder(
		Component component,
		String path,
		PropertyData inferredData,
		PropertyHolder parent,
		Mappings mappings) {
	super( path, parent, inferredData.getPropertyClass(), mappings );
	final XProperty embeddedXProperty = inferredData.getProperty();
	setCurrentProperty( embeddedXProperty );
	this.component = component;
	this.isOrWithinEmbeddedId =
			parent.isOrWithinEmbeddedId()
					|| ( embeddedXProperty != null &&
					( embeddedXProperty.isAnnotationPresent( Id.class )
							|| embeddedXProperty.isAnnotationPresent( EmbeddedId.class ) ) );

	this.virtual = embeddedXProperty == null;
	if ( !virtual ) {
		this.embeddedAttributeName = embeddedXProperty.getName();
		this.attributeConversionInfoMap = processAttributeConversions( embeddedXProperty );
	}
	else {
		embeddedAttributeName = "";
		this.attributeConversionInfoMap = Collections.emptyMap();
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:ComponentPropertyHolder.java


示例4: fillComponent

import org.hibernate.mapping.Component; //导入依赖的package包/类
public static Component fillComponent(
		PropertyHolder propertyHolder,
		PropertyData inferredData,
		AccessType propertyAccessor,
		boolean isNullable,
		EntityBinder entityBinder,
		boolean isComponentEmbedded,
		boolean isIdentifierMapper,
		boolean inSecondPass,
		Mappings mappings,
		Map<XClass, InheritanceState> inheritanceStatePerClass) {
	return fillComponent(
			propertyHolder, inferredData, null, propertyAccessor,
			isNullable, entityBinder, isComponentEmbedded, isIdentifierMapper, inSecondPass, mappings,
			inheritanceStatePerClass
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:AnnotationBinder.java


示例5: createComponent

import org.hibernate.mapping.Component; //导入依赖的package包/类
public static Component createComponent(
		PropertyHolder propertyHolder,
		PropertyData inferredData,
		boolean isComponentEmbedded,
		boolean isIdentifierMapper,
		Mappings mappings) {
	Component comp = new Component( mappings, propertyHolder.getPersistentClass() );
	comp.setEmbedded( isComponentEmbedded );
	//yuk
	comp.setTable( propertyHolder.getTable() );
	//FIXME shouldn't identifier mapper use getClassOrElementName? Need to be checked.
	if ( isIdentifierMapper || ( isComponentEmbedded && inferredData.getPropertyName() == null ) ) {
		comp.setComponentClassName( comp.getOwner().getClassName() );
	}
	else {
		comp.setComponentClassName( inferredData.getClassOrElementName() );
	}
	comp.setNodeName( inferredData.getPropertyName() );
	return comp;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:AnnotationBinder.java


示例6: PojoInstantiator

import org.hibernate.mapping.Component; //导入依赖的package包/类
public PojoInstantiator(Component component, ReflectionOptimizer.InstantiationOptimizer optimizer) {
	this.mappedClass = component.getComponentClass();
	this.isAbstract = ReflectHelper.isAbstractClass( mappedClass );
	this.optimizer = optimizer;

	this.proxyInterface = null;
	this.embeddedIdentifier = false;

	try {
		constructor = ReflectHelper.getDefaultConstructor(mappedClass);
	}
	catch ( PropertyNotFoundException pnfe ) {
		LOG.noDefaultConstructor(mappedClass.getName());
		constructor = null;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:PojoInstantiator.java


示例7: AbstractComponentTuplizer

import org.hibernate.mapping.Component; //导入依赖的package包/类
protected AbstractComponentTuplizer(Component component) {
	propertySpan = component.getPropertySpan();
	getters = new Getter[propertySpan];
	setters = new Setter[propertySpan];

	Iterator iter = component.getPropertyIterator();
	boolean foundCustomAccessor=false;
	int i = 0;
	while ( iter.hasNext() ) {
		Property prop = ( Property ) iter.next();
		getters[i] = buildGetter( component, prop );
		setters[i] = buildSetter( component, prop );
		if ( !prop.isBasicPropertyAccessor() ) {
			foundCustomAccessor = true;
		}
		i++;
	}
	hasCustomAccessors = foundCustomAccessor;
	instantiator = buildInstantiator( component );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:AbstractComponentTuplizer.java


示例8: ComponentMetamodel

import org.hibernate.mapping.Component; //导入依赖的package包/类
public ComponentMetamodel(Component component) {
//		this.sessionFactory = sessionFactory;
		this.role = component.getRoleName();
		this.isKey = component.isKey();
		propertySpan = component.getPropertySpan();
		properties = new StandardProperty[propertySpan];
		Iterator itr = component.getPropertyIterator();
		int i = 0;
		while ( itr.hasNext() ) {
			Property property = ( Property ) itr.next();
			properties[i] = PropertyFactory.buildStandardProperty( property, false );
			propertyIndexes.put( property.getName(), i );
			i++;
		}

		entityMode = component.hasPojoRepresentation() ? EntityMode.POJO : EntityMode.MAP;

		// todo : move this to SF per HHH-3517; also see HHH-1907 and ComponentMetamodel
		final ComponentTuplizerFactory componentTuplizerFactory = new ComponentTuplizerFactory();
		final String tuplizerClassName = component.getTuplizerImplClassName( entityMode );
		this.componentTuplizer = tuplizerClassName == null ? componentTuplizerFactory.constructDefaultTuplizer(
				entityMode,
				component
		) : componentTuplizerFactory.constructTuplizer( tuplizerClassName, component );
	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:ComponentMetamodel.java


示例9: bindComposite

import org.hibernate.mapping.Component; //导入依赖的package包/类
public static void bindComposite(Element node, Component component, String path,
		boolean isNullable, Mappings mappings, java.util.Map inheritedMetas)
		throws MappingException {
	bindComponent(
			node,
			component,
			null,
			null,
			path,
			isNullable,
			false,
			mappings,
			inheritedMetas,
			false
		);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:HbmBinder.java


示例10: PojoInstantiator

import org.hibernate.mapping.Component; //导入依赖的package包/类
public PojoInstantiator(Component component, ReflectionOptimizer.InstantiationOptimizer optimizer) {
	this.mappedClass = component.getComponentClass();
	this.optimizer = optimizer;

	this.proxyInterface = null;
	this.embeddedIdentifier = false;

	try {
		constructor = ReflectHelper.getDefaultConstructor(mappedClass);
	}
	catch ( PropertyNotFoundException pnfe ) {
		log.info(
		        "no default (no-argument) constructor for class: " +
				mappedClass.getName() +
				" (class must be instantiated by Interceptor)"
		);
		constructor = null;
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:20,代码来源:PojoInstantiator.java


示例11: ComponentMetamodel

import org.hibernate.mapping.Component; //导入依赖的package包/类
public ComponentMetamodel(Component component) {
//		this.sessionFactory = sessionFactory;
		this.role = component.getRoleName();
		this.isKey = component.isKey();
		propertySpan = component.getPropertySpan();
		properties = new StandardProperty[propertySpan];
		Iterator itr = component.getPropertyIterator();
		int i = 0;
		while ( itr.hasNext() ) {
			Property property = ( Property ) itr.next();
			properties[i] = PropertyFactory.buildStandardProperty( property, false );
			propertyIndexes.put( property.getName(), new Integer( i ) );
			i++;
		}

		tuplizerMapping = new ComponentEntityModeToTuplizerMapping( component );
	}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:18,代码来源:ComponentMetamodel.java


示例12: testProperCallbacks

import org.hibernate.mapping.Component; //导入依赖的package包/类
public void testProperCallbacks() {

		ValueVisitor vv = new ValueVisitorValidator();
		
		new Any(new Table()).accept(vv);
		new Array(new RootClass()).accept(vv);
		new Bag(new RootClass()).accept(vv);
		new Component(new RootClass()).accept(vv);
		new DependantValue(null,null).accept(vv);
		new IdentifierBag(null).accept(vv);
		new List(null).accept(vv);
		new ManyToOne(null).accept(vv);
		new Map(null).accept(vv);
		new OneToMany(null).accept(vv);
		new OneToOne(null, new RootClass() ).accept(vv);
		new PrimitiveArray(null).accept(vv);
		new Set(null).accept(vv);
		new SimpleValue().accept(vv);
	
		
	}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:22,代码来源:ValueVisitorTest.java


示例13: afterConfigurationBuilt

import org.hibernate.mapping.Component; //导入依赖的package包/类
public void afterConfigurationBuilt(Mappings mappings, Dialect dialect) {
	super.afterConfigurationBuilt( mappings, dialect );
	// Oracle and Postgres do not have year() functions, so we need to
	// redefine the 'User.person.yob' formula
	//
	// consider temporary until we add the capability to define
	// mapping foprmulas which can use dialect-registered functions...
	PersistentClass user = mappings.getClass( User.class.getName() );
	org.hibernate.mapping.Property personProperty = user.getProperty( "person" );
	Component component = ( Component ) personProperty.getValue();
	Formula f = ( Formula ) component.getProperty( "yob" ).getValue().getColumnIterator().next();

	SQLFunction yearFunction = ( SQLFunction ) dialect.getFunctions().get( "year" );
	if ( yearFunction == null ) {
		// the dialect not know to support a year() function, so rely on the
		// ANSI SQL extract function
		f.setFormula( "extract( year from dob )");
	}
	else {
		List args = new ArrayList();
		args.add( "dob" );
		f.setFormula( yearFunction.render( args, null ) );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:25,代码来源:ComponentTest.java


示例14: EmbeddableMapperImpl

import org.hibernate.mapping.Component; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public EmbeddableMapperImpl(
		PersisterCreationContext creationContext,
		ManagedTypeImplementor superTypeDescriptor,
		EmbeddableContainer compositeContainer,
		String locaName,
		Component embeddedMapping,
		MutabilityPlan mutabilityPlan,
		Comparator comparator,
		List<Column> allColumns) {
	super( resolveJtd( creationContext, embeddedMapping, mutabilityPlan, comparator ) );

	this.compositeContainer = compositeContainer;
	this.locaName = locaName;
	this.roleName = compositeContainer.getRolePrefix() + '.' + locaName;
	this.allColumns = allColumns;

	this.ormType = new EmbeddedTypeImpl( null, roleName, getJavaTypeDescriptor() );

	setTypeConfiguration( creationContext.getTypeConfiguration() );
	ormType.setTypeConfiguration( creationContext.getTypeConfiguration() );
}
 
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:23,代码来源:EmbeddableMapperImpl.java


示例15: resolveJtd

import org.hibernate.mapping.Component; //导入依赖的package包/类
private static EmbeddableJavaTypeDescriptor resolveJtd(
		PersisterCreationContext creationContext,
		Component embeddedMapping,
		MutabilityPlan mutabilityPlan,
		Comparator comparator) {
	JavaTypeDescriptorRegistry jtdr = creationContext.getTypeConfiguration().getJavaTypeDescriptorRegistry();
	EmbeddableJavaTypeDescriptor jtd = (EmbeddableJavaTypeDescriptor) jtdr.getDescriptor( embeddedMapping.getType().getName() );
	if ( jtd == null ) {
		jtd = new EmbeddableJavaTypeDescriptorImpl(
				embeddedMapping.getType().getName(),
				embeddedMapping.getType().getReturnedClass(),
				null,
				mutabilityPlan,
				comparator
		);
		jtdr.addDescriptor( jtd );
	}
	return jtd;
}
 
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:20,代码来源:EmbeddableMapperImpl.java


示例16: createEmbeddablePersister

import org.hibernate.mapping.Component; //导入依赖的package包/类
@Override
public EmbeddableMapper createEmbeddablePersister(
		Component componentBinding,
		EmbeddableContainer source,
		String localName,
		PersisterCreationContext creationContext) throws HibernateException {
	final EmbeddableMapperImpl mapper = new EmbeddableMapperImpl(
			creationContext,
			null,
			source,
			localName,
			componentBinding,
			null,
			null,
			null
	);
	embeddableComponentMap.put( mapper, componentBinding );
	mapper.setTypeConfiguration( creationContext.getTypeConfiguration() );
	return mapper;
}
 
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:21,代码来源:PersisterFactoryImpl.java


示例17: convertComposite

import org.hibernate.mapping.Component; //导入依赖的package包/类
public static EmbeddedType convertComposite(
		PersisterCreationContext creationContext,
		String navigableName,
		Component navigableType,
		EmbeddableContainer source,
		TypeConfiguration typeConfiguration) {
	final String roleName = source.getRolePrefix() + navigableName;
	EmbeddableMapper mapper = typeConfiguration.findEmbeddableMapper( roleName );
	if ( mapper == null ) {
		mapper = creationContext.getPersisterFactory().createEmbeddablePersister(
				navigableType,
				source,
				navigableName,
				creationContext
		);
		creationContext.registerEmbeddablePersister( mapper );
	}
	return mapper.getOrmType();
}
 
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:20,代码来源:OrmTypeHelper.java


示例18: getNestedInnerComponentNames

import org.hibernate.mapping.Component; //导入依赖的package包/类
public List<String> getNestedInnerComponentNames(String parentClassname, String topLevelComponentName,
    String nestedComponentName, String innerComponentNamePrefix) {
    List<String> names = new ArrayList<String>();
    PersistentClass parent = configuration.getClassMapping(parentClassname);
    Property topLevelProperty = parent.getProperty(topLevelComponentName);
    Component topLevelComponent = (Component) topLevelProperty.getValue();
    Property nestedProperty = topLevelComponent.getProperty(nestedComponentName);
    Set nestedSet = (Set) nestedProperty.getValue();
    Component nestedComponent = (Component) nestedSet.getElement();
    Iterator<?> propertyIter = nestedComponent.getPropertyIterator();
    while (propertyIter.hasNext()) {
        Property prop = (Property) propertyIter.next();
        if (prop.getName().startsWith(innerComponentNamePrefix)) {
            names.add(prop.getName());
        }
    }
    return names;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:HibernateConfigTypesInformationResolver.java


示例19: bindCompositeId

import org.hibernate.mapping.Component; //导入依赖的package包/类
private static void bindCompositeId(Element idNode, RootClass entity, Mappings mappings,
		java.util.Map inheritedMetas) throws MappingException {
	String propertyName = idNode.attributeValue( "name" );
	Component id = new Component( mappings, entity );
	entity.setIdentifier( id );
	bindCompositeId( idNode, id, entity, propertyName, mappings, inheritedMetas );
	if ( propertyName == null ) {
		entity.setEmbeddedIdentifier( id.isEmbedded() );
		if ( id.isEmbedded() ) {
			// todo : what is the implication of this?
			id.setDynamic( !entity.hasPojoRepresentation() );
			/*
			 * Property prop = new Property(); prop.setName("id");
			 * prop.setPropertyAccessorName("embedded"); prop.setValue(id);
			 * entity.setIdentifierProperty(prop);
			 */
		}
	}
	else {
		Property prop = new Property();
		prop.setValue( id );
		bindProperty( idNode, prop, mappings, inheritedMetas );
		entity.setIdentifierProperty( prop );
		entity.setDeclaredIdentifierProperty( prop );
	}

	makeIdentifier( idNode, id, mappings );

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:HbmBinder.java


示例20: isInPrimaryKey

import org.hibernate.mapping.Component; //导入依赖的package包/类
@Override
   public boolean isInPrimaryKey() {
	if ( entityClassName == null ) return false;
	final PersistentClass persistentClass = mappings.getClass( entityClassName );
	Property property = persistentClass.getIdentifierProperty();
	if ( path == null ) {
		return false;
	}
	else if ( property != null) {
		//try explicit identifier property
		return path.startsWith( property.getName() + "." );
	}
	else {
		//try the embedded property
		//embedded property starts their path with 'id.' See PropertyPreloadedData( ) use when idClass != null in AnnotationSourceProcessor
		if ( path.startsWith( "id." ) ) {
			KeyValue valueIdentifier = persistentClass.getIdentifier();
			String localPath = path.substring( 3 );
			if ( valueIdentifier instanceof Component ) {
				Iterator it = ( (Component) valueIdentifier ).getPropertyIterator();
				while ( it.hasNext() ) {
					Property idProperty = (Property) it.next();
					if ( localPath.startsWith( idProperty.getName() ) ) return true;
				}

			}
		}
	}
	return false;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:ToOneFkSecondPass.java



注:本文中的org.hibernate.mapping.Component类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Pool类代码示例发布时间:2022-05-23
下一篇:
Java HttpInvokerClientConfiguration类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap