本文整理汇总了Java中org.hibernate.tuple.StandardProperty类的典型用法代码示例。如果您正苦于以下问题:Java StandardProperty类的具体用法?Java StandardProperty怎么用?Java StandardProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StandardProperty类属于org.hibernate.tuple包,在下文中一共展示了StandardProperty类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ComponentMetamodel
import org.hibernate.tuple.StandardProperty; //导入依赖的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 );
}
示例2: ComponentType
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
public ComponentType(TypeFactory.TypeScope typeScope, ComponentMetamodel metamodel) {
this.typeScope = typeScope;
// for now, just "re-flatten" the metamodel since this is temporary stuff anyway (HHH-1907)
this.isKey = metamodel.isKey();
this.propertySpan = metamodel.getPropertySpan();
this.propertyNames = new String[ propertySpan ];
this.propertyTypes = new Type[ propertySpan ];
this.propertyNullability = new boolean[ propertySpan ];
this.cascade = new CascadeStyle[ propertySpan ];
this.joinedFetch = new FetchMode[ propertySpan ];
for ( int i = 0; i < propertySpan; i++ ) {
StandardProperty prop = metamodel.getProperty( i );
this.propertyNames[i] = prop.getName();
this.propertyTypes[i] = prop.getType();
this.propertyNullability[i] = prop.isNullable();
this.cascade[i] = prop.getCascadeStyle();
this.joinedFetch[i] = prop.getFetchMode();
if (!prop.isNullable()) {
hasNotNullProperty = true;
}
}
this.entityMode = metamodel.getEntityMode();
this.componentTuplizer = metamodel.getComponentTuplizer();
}
示例3: getPropertyValues
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
public Object[] getPropertyValues(Object entity) throws HibernateException {
boolean getAll = shouldGetAllProperties( entity );
final int span = entityMetamodel.getPropertySpan();
final Object[] result = new Object[span];
for ( int j = 0; j < span; j++ ) {
StandardProperty property = entityMetamodel.getProperties()[j];
if ( getAll || !property.isLazy() ) {
result[j] = getters[j].get( entity );
}
else {
result[j] = LazyPropertyInitializer.UNFETCHED_PROPERTY;
}
}
return result;
}
示例4: ComponentMetamodel
import org.hibernate.tuple.StandardProperty; //导入依赖的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 );
}
示例5: ComponentType
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
public ComponentType(ComponentMetamodel metamodel) {
// for now, just "re-flatten" the metamodel since this is temporary stuff anyway (HHH-1907)
this.isKey = metamodel.isKey();
this.propertySpan = metamodel.getPropertySpan();
this.propertyNames = new String[ propertySpan ];
this.propertyTypes = new Type[ propertySpan ];
this.propertyNullability = new boolean[ propertySpan ];
this.cascade = new CascadeStyle[ propertySpan ];
this.joinedFetch = new FetchMode[ propertySpan ];
for ( int i = 0; i < propertySpan; i++ ) {
StandardProperty prop = metamodel.getProperty( i );
this.propertyNames[i] = prop.getName();
this.propertyTypes[i] = prop.getType();
this.propertyNullability[i] = prop.isNullable();
this.cascade[i] = prop.getCascadeStyle();
this.joinedFetch[i] = prop.getFetchMode();
}
this.tuplizerMapping = metamodel.getTuplizerMapping();
}
示例6: determineInsertValueGenerationType
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
private ValueInclusion determineInsertValueGenerationType(Property mappingProperty, StandardProperty runtimeProperty) {
if ( runtimeProperty.isInsertGenerated() ) {
return ValueInclusion.FULL;
}
else if ( mappingProperty.getValue() instanceof Component ) {
if ( hasPartialInsertComponentGeneration( ( Component ) mappingProperty.getValue() ) ) {
return ValueInclusion.PARTIAL;
}
}
return ValueInclusion.NONE;
}
示例7: determineUpdateValueGenerationType
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
private ValueInclusion determineUpdateValueGenerationType(Property mappingProperty, StandardProperty runtimeProperty) {
if ( runtimeProperty.isUpdateGenerated() ) {
return ValueInclusion.FULL;
}
else if ( mappingProperty.getValue() instanceof Component ) {
if ( hasPartialUpdateComponentGeneration( ( Component ) mappingProperty.getValue() ) ) {
return ValueInclusion.PARTIAL;
}
}
return ValueInclusion.NONE;
}
示例8: findDirty
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
/**
* Determine if any of the given field values are dirty, returning an array containing
* indices of the dirty fields.
* <p/>
* If it is determined that no fields are dirty, null is returned.
*
* @param properties The property definitions
* @param currentState The current state of the entity
* @param previousState The baseline state of the entity
* @param includeColumns Columns to be included in the dirty checking, per property
* @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
* @param session The session from which the dirty check request originated.
* @return Array containing indices of the dirty properties, or null if no properties considered dirty.
*/
public static int[] findDirty(
final StandardProperty[] properties,
final Object[] currentState,
final Object[] previousState,
final boolean[][] includeColumns,
final boolean anyUninitializedProperties,
final SessionImplementor session) {
int[] results = null;
int count = 0;
int span = properties.length;
for ( int i = 0; i < span; i++ ) {
final boolean dirty = currentState[i] != LazyPropertyInitializer.UNFETCHED_PROPERTY
&& properties[i].isDirtyCheckable( anyUninitializedProperties )
&& properties[i].getType().isDirty( previousState[i], currentState[i], includeColumns[i], session );
if ( dirty ) {
if ( results == null ) {
results = new int[span];
}
results[count++] = i;
}
}
if ( count == 0 ) {
return null;
}
else {
int[] trimmed = new int[count];
System.arraycopy( results, 0, trimmed, 0, count );
return trimmed;
}
}
示例9: findModified
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
/**
* Determine if any of the given field values are modified, returning an array containing
* indices of the modified fields.
* <p/>
* If it is determined that no fields are dirty, null is returned.
*
* @param properties The property definitions
* @param currentState The current state of the entity
* @param previousState The baseline state of the entity
* @param includeColumns Columns to be included in the mod checking, per property
* @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
* @param session The session from which the dirty check request originated.
* @return Array containing indices of the modified properties, or null if no properties considered modified.
*/
public static int[] findModified(
final StandardProperty[] properties,
final Object[] currentState,
final Object[] previousState,
final boolean[][] includeColumns,
final boolean anyUninitializedProperties,
final SessionImplementor session) {
int[] results = null;
int count = 0;
int span = properties.length;
for ( int i = 0; i < span; i++ ) {
final boolean modified = currentState[i]!=LazyPropertyInitializer.UNFETCHED_PROPERTY
&& properties[i].isDirtyCheckable(anyUninitializedProperties)
&& properties[i].getType().isModified( previousState[i], currentState[i], includeColumns[i], session );
if ( modified ) {
if ( results == null ) {
results = new int[span];
}
results[count++] = i;
}
}
if ( count == 0 ) {
return null;
}
else {
int[] trimmed = new int[count];
System.arraycopy( results, 0, trimmed, 0, count );
return trimmed;
}
}
示例10: getProperties
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
public StandardProperty[] getProperties() {
return properties;
}
示例11: getProperty
import org.hibernate.tuple.StandardProperty; //导入依赖的package包/类
public StandardProperty getProperty(int index) {
if ( index < 0 || index >= propertySpan ) {
throw new IllegalArgumentException( "illegal index value for component property access [request=" + index + ", span=" + propertySpan + "]" );
}
return properties[index];
}