org.hibernate.Hibernate#isPropertyInitialized ( )源码实例Demo

下面列出了org.hibernate.Hibernate#isPropertyInitialized ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: HibernateTraversableResolver.java
public boolean isReachable(Object traversableObject,
		Path.Node traversableProperty,
		Class<?> rootBeanType,
		Path pathToTraversableObject,
		ElementType elementType) {
	//lazy, don't load
	return Hibernate.isInitialized( traversableObject )
			&& Hibernate.isPropertyInitialized( traversableObject, traversableProperty.getName() );
}
 
源代码2 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodEnter
static void enter(@FieldValue Collection<?> field, @Advice.Argument(0) Collection<?> argument, @MappedBy String mappedBy) {
	if ( field != null && Hibernate.isPropertyInitialized( field, mappedBy ) ) {
		Object[] array = field.toArray();
		for ( int i = 0; i < array.length; i++ ) {
			if ( argument == null || !argument.contains( array[i] ) ) {
				setterNull( array[i], null );
			}
		}
	}
}
 
源代码3 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodExit
static void exit(@Advice.This Object self, @Advice.Argument(0) Collection<?> argument, @MappedBy String mappedBy) {
	if ( argument != null && Hibernate.isPropertyInitialized( argument, mappedBy ) ) {
		Object[] array = argument.toArray();
		for ( int i = 0; i < array.length; i++ ) {
			if ( Hibernate.isPropertyInitialized( array[i], mappedBy ) && getter( array[i] ) != self ) {
				setterSelf( array[i], self );
			}
		}
	}
}
 
源代码4 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodEnter
static void enter(@FieldValue Map<?, ?> field, @Advice.Argument(0) Map<?, ?> argument, @MappedBy String mappedBy) {
	if ( field != null && Hibernate.isPropertyInitialized( field, mappedBy ) ) {
		Object[] array = field.values().toArray();
		for ( int i = 0; i < array.length; i++ ) {
			if ( argument == null || !argument.values().contains( array[i] ) ) {
				setterNull( array[i], null );
			}
		}
	}
}
 
源代码5 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodExit
static void exit(@Advice.This Object self, @Advice.Argument(0) Map<?, ?> argument, @MappedBy String mappedBy) {
	if ( argument != null && Hibernate.isPropertyInitialized( argument, mappedBy ) ) {
		Object[] array = argument.values().toArray();
		for ( int i = 0; i < array.length; i++ ) {
			if ( Hibernate.isPropertyInitialized( array[i], mappedBy ) && getter( array[i] ) != self ) {
				setterSelf( array[i], self );
			}
		}
	}
}
 
源代码6 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodEnter
static void enter(@Advice.This Object self, @FieldValue Object field, @MappedBy String mappedBy) {
	if ( field != null && Hibernate.isPropertyInitialized( field, mappedBy ) ) {
		Collection<?> c = getter( field );
		if ( c != null ) {
			c.remove( self );
		}
	}
}
 
源代码7 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodExit
static void exit(@Advice.This Object self, @Advice.Argument(0) Object argument, @MappedBy String mappedBy) {
	if ( argument != null && Hibernate.isPropertyInitialized( argument, mappedBy ) ) {
		Collection<Object> c = getter( argument );
		if ( c != null && !c.contains( self ) ) {
			c.add( self );
		}
	}
}
 
源代码8 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodEnter
static void enter(@Advice.This Object self, @FieldValue Collection<?> field, @Advice.Argument(0) Collection<?> argument, @MappedBy String mappedBy) {
	if ( field != null && Hibernate.isPropertyInitialized( field, mappedBy ) ) {
		Object[] array = field.toArray();
		for ( int i = 0; i < array.length; i++ ) {
			if ( argument == null || !argument.contains( array[i] ) ) {
				getter( array[i] ).remove( self );
			}
		}
	}
}
 
源代码9 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodExit
static void exit(@Advice.This Object self, @Advice.Argument(0) Collection<?> argument, @MappedBy String mappedBy) {
	if ( argument != null && Hibernate.isPropertyInitialized( argument, mappedBy ) ) {
		Object[] array = argument.toArray();
		for ( int i = 0; i < array.length; i++ ) {
			if ( Hibernate.isPropertyInitialized( array[i], mappedBy ) ) {
				Collection<Object> c = getter( array[i] );
				if ( c != self && c != null ) {
					c.add( self );
				}
			}
		}
	}
}
 
源代码10 项目: unitime   文件: Location.java
@Deprecated
  public String getHtmlHint(String preference) {
try {
	if (!Hibernate.isPropertyInitialized(this, "roomType") || !Hibernate.isInitialized(getRoomType())) {
		return LocationDAO.getInstance().get(getUniqueId()).getHtmlHintImpl(preference);
	} else {
		return getHtmlHintImpl(preference);
	}
} catch (LazyInitializationException e) {
	return LocationDAO.getInstance().get(getUniqueId()).getHtmlHintImpl(preference);
}
  }
 
源代码11 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodEnter
static void enter(@FieldValue Object field, @Advice.Argument(0) Object argument, @MappedBy String mappedBy) {
	if ( field != null && Hibernate.isPropertyInitialized( field, mappedBy ) && argument != null ) {
		setterNull( field, null );
	}
}
 
源代码12 项目: lams   文件: CodeTemplates.java
@Advice.OnMethodExit
static void exit(@Advice.This Object self, @Advice.Argument(0) Object argument, @MappedBy String mappedBy) {
	if ( argument != null && Hibernate.isPropertyInitialized( argument, mappedBy ) && getter( argument ) != self ) {
		setterSelf( argument, self );
	}
}