类org.hibernate.annotations.Target源码实例Demo

下面列出了怎么用org.hibernate.annotations.Target的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: PropertyContainer.java
private static boolean discoverTypeWithoutReflection(XProperty p) {
	if ( p.isAnnotationPresent( OneToOne.class ) && !p.getAnnotation( OneToOne.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( OneToMany.class ) && !p.getAnnotation( OneToMany.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( ManyToOne.class ) && !p.getAnnotation( ManyToOne.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( ManyToMany.class ) && !p.getAnnotation( ManyToMany.class )
			.targetEntity()
			.equals( void.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( org.hibernate.annotations.Any.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( ManyToAny.class ) ) {
		if ( !p.isCollection() && !p.isArray() ) {
			throw new AnnotationException( "@ManyToAny used on a non collection non array property: " + p.getName() );
		}
		return true;
	}
	else if ( p.isAnnotationPresent( Type.class ) ) {
		return true;
	}
	else if ( p.isAnnotationPresent( Target.class ) ) {
		return true;
	}
	return false;
}
 
源代码2 项目: lams   文件: PropertyInferredData.java
public XClass getPropertyClass() throws MappingException {
	if ( property.isAnnotationPresent( Target.class ) ) {
		return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() );
	}
	else {
		return property.getType();
	}
}
 
源代码3 项目: lams   文件: PropertyInferredData.java
public XClass getClassOrElement() throws MappingException {
	if ( property.isAnnotationPresent( Target.class ) ) {
		return reflectionManager.toXClass( property.getAnnotation( Target.class ).value() );
	}
	else {
		return property.getClassOrElementClass();
	}
}
 
 类所在包
 类方法
 同包方法