当前位置: 首页>>代码示例>>Java>>正文


Java Property.setPropertyAccessorName方法代码示例

本文整理汇总了Java中org.hibernate.mapping.Property.setPropertyAccessorName方法的典型用法代码示例。如果您正苦于以下问题:Java Property.setPropertyAccessorName方法的具体用法?Java Property.setPropertyAccessorName怎么用?Java Property.setPropertyAccessorName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.mapping.Property的用法示例。


在下文中一共展示了Property.setPropertyAccessorName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shallowCopy

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
/**
 * create a property copy reusing the same value
 */
public static Property shallowCopy(Property property) {
	Property clone = new Property();
	clone.setCascade( property.getCascade() );
	clone.setInsertable( property.isInsertable() );
	clone.setLazy( property.isLazy() );
	clone.setName( property.getName() );
	clone.setNodeName( property.getNodeName() );
	clone.setNaturalIdentifier( property.isNaturalIdentifier() );
	clone.setOptimisticLocked( property.isOptimisticLocked() );
	clone.setOptional( property.isOptional() );
	clone.setPersistentClass( property.getPersistentClass() );
	clone.setPropertyAccessorName( property.getPropertyAccessorName() );
	clone.setSelectable( property.isSelectable() );
	clone.setUpdateable( property.isUpdateable() );
	clone.setValue( property.getValue() );
	return clone;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:BinderHelper.java

示例2: buildPropertyGetter

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
@Override
protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity) {
    if (!"property".equals(mappedProperty.getPropertyAccessorName())) {
        mappedProperty.setPropertyAccessorName(OptionAwareDirectPropertyAccessor.class.getName());
    }
    return super.buildPropertyGetter(mappedProperty, mappedEntity);
}
 
开发者ID:solita,项目名称:query-utils,代码行数:8,代码来源:OptionAwarePojoEntityTuplizer.java

示例3: buildPropertySetter

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
@Override
protected Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity) {
    if (!"property".equals(mappedProperty.getPropertyAccessorName())) {
        mappedProperty.setPropertyAccessorName(OptionAwareDirectPropertyAccessor.class.getName());
    }
    return super.buildPropertySetter(mappedProperty, mappedEntity);
}
 
开发者ID:solita,项目名称:query-utils,代码行数:8,代码来源:OptionAwarePojoEntityTuplizer.java

示例4: bindCompositeId

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
public static void bindCompositeId(Element node, Component component,
		PersistentClass persistentClass, String propertyName, Mappings mappings,
		java.util.Map inheritedMetas) throws MappingException {

	component.setKey( true );

	String path = StringHelper.qualify(
			persistentClass.getEntityName(),
			propertyName == null ? "id" : propertyName );

	bindComponent(
			node,
			component,
			persistentClass.getClassName(),
			propertyName,
			path,
			false,
			node.attribute( "class" ) == null
					&& propertyName == null,
			mappings,
			inheritedMetas,
			false
		);

	if ( "true".equals( node.attributeValue("mapped") ) ) {
		if ( propertyName!=null ) {
			throw new MappingException("cannot combine mapped=\"true\" with specified name");
		}
		Component mapper = new Component( mappings, persistentClass );
		bindComponent(
				node,
				mapper,
				persistentClass.getClassName(),
				null,
				path,
				false,
				true,
				mappings,
				inheritedMetas,
				true
			);
		persistentClass.setIdentifierMapper(mapper);
		Property property = new Property();
		property.setName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY );
		property.setNodeName("id");
		property.setUpdateable(false);
		property.setInsertable(false);
		property.setValue(mapper);
		property.setPropertyAccessorName( "embedded" );
		persistentClass.addProperty(property);
	}

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

示例5: makeProperty

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
public Property makeProperty() {
	validateMake();
	LOG.debugf( "Building property %s", name );
	Property prop = new Property();
	prop.setName( name );
	prop.setNodeName( name );
	prop.setValue( value );
	prop.setLazy( lazy );
	prop.setCascade( cascade );
	prop.setPropertyAccessorName( accessType.getType() );

	if ( property != null ) {
		prop.setValueGenerationStrategy( determineValueGenerationStrategy( property ) );
	}

	NaturalId naturalId = property != null ? property.getAnnotation( NaturalId.class ) : null;
	if ( naturalId != null ) {
		if ( ! entityBinder.isRootEntity() ) {
			throw new AnnotationException( "@NaturalId only valid on root entity (or its @MappedSuperclasses)" );
		}
		if ( ! naturalId.mutable() ) {
			updatable = false;
		}
		prop.setNaturalIdentifier( true );
	}

	// HHH-4635 -- needed for dialect-specific property ordering
	Lob lob = property != null ? property.getAnnotation( Lob.class ) : null;
	prop.setLob( lob != null );

	prop.setInsertable( insertable );
	prop.setUpdateable( updatable );

	// this is already handled for collections in CollectionBinder...
	if ( Collection.class.isInstance( value ) ) {
		prop.setOptimisticLocked( ( (Collection) value ).isOptimisticLocked() );
	}
	else {
		final OptimisticLock lockAnn = property != null
				? property.getAnnotation( OptimisticLock.class )
				: null;
		if ( lockAnn != null ) {
			//TODO this should go to the core as a mapping validation checking
			if ( lockAnn.excluded() && (
					property.isAnnotationPresent( javax.persistence.Version.class )
							|| property.isAnnotationPresent( Id.class )
							|| property.isAnnotationPresent( EmbeddedId.class ) ) ) {
				throw new AnnotationException(
						"@OptimisticLock.exclude=true incompatible with @Id, @EmbeddedId and @Version: "
								+ StringHelper.qualify( holder.getPath(), name )
				);
			}
		}
		final boolean isOwnedValue = !isToOneValue( value ) || insertable; // && updatable as well???
		final boolean includeInOptimisticLockChecks = ( lockAnn != null )
				? ! lockAnn.excluded()
				: isOwnedValue;
		prop.setOptimisticLocked( includeInOptimisticLockChecks );
	}

	LOG.tracev( "Cascading {0} with {1}", name, cascade );
	this.mappingProperty = prop;
	return prop;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:65,代码来源:PropertyBinder.java

示例6: bindCompositeId

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
public static void bindCompositeId(Element node, Component component,
		PersistentClass persistentClass, String propertyName, Mappings mappings,
		java.util.Map inheritedMetas) throws MappingException {

	component.setKey( true );

	String path = StringHelper.qualify(
			persistentClass.getEntityName(),
			propertyName == null ? "id" : propertyName );

	bindComponent(
			node,
			component,
			persistentClass.getClassName(),
			propertyName,
			path,
			false,
			node.attribute( "class" ) == null
					&& propertyName == null,
			mappings,
			inheritedMetas,
			false
		);

	if ( "true".equals( node.attributeValue("mapped") ) ) {
		if ( propertyName!=null ) {
			throw new MappingException("cannot combine mapped=\"true\" with specified name");
		}
		Component mapper = new Component(persistentClass);
		bindComponent(
				node,
				mapper,
				persistentClass.getClassName(),
				null,
				path,
				false,
				true,
				mappings,
				inheritedMetas,
				true
			);
		persistentClass.setIdentifierMapper(mapper);
		Property property = new Property();
		property.setName("_identifierMapper");
		property.setNodeName("id");
		property.setUpdateable(false);
		property.setInsertable(false);
		property.setValue(mapper);
		property.setPropertyAccessorName( "embedded" );
		persistentClass.addProperty(property);
	}

}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:54,代码来源:HbmBinder.java

示例7: buildGetter

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
@Override
protected Getter buildGetter(Component component, Property prop) {
    prop.setPropertyAccessorName(OptionAwareDirectPropertyAccessor.class.getName());
    return prop.getGetter(component.getComponentClass());
}
 
开发者ID:solita,项目名称:query-utils,代码行数:6,代码来源:OptionAwarePojoComponentTuplizer.java

示例8: buildSetter

import org.hibernate.mapping.Property; //导入方法依赖的package包/类
@Override
protected Setter buildSetter(Component component, Property prop) {
    prop.setPropertyAccessorName(OptionAwareDirectPropertyAccessor.class.getName());
    return prop.getSetter(component.getComponentClass());
}
 
开发者ID:solita,项目名称:query-utils,代码行数:6,代码来源:OptionAwarePojoComponentTuplizer.java


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