public static String getReferenceEntityName(PropertyData propertyData, XClass targetEntity, MetadataBuildingContext buildingContext) { if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
private XClass getCollectionType() { if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) { if ( collectionType != null ) { return collectionType; } else { String errorMsg = "Collection has neither generic type or OneToMany.targetEntity() defined: " + safeCollectionRole(); throw new AnnotationException( errorMsg ); } } else { return targetEntity; } }
public static String getReferenceEntityName(PropertyData propertyData, MetadataBuildingContext buildingContext) { XClass targetEntity = getTargetEntity( propertyData, buildingContext ); if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
@SuppressWarnings({ "unchecked" }) public void setProxy(Proxy proxy) { if ( proxy != null ) { lazy = proxy.lazy(); if ( !lazy ) { proxyClass = null; } else { final ReflectionManager reflectionManager = context.getBootstrapContext().getReflectionManager(); if ( AnnotationBinder.isDefault( reflectionManager.toXClass( proxy.proxyClass() ), context ) ) { proxyClass = annotatedClass; } else { proxyClass = reflectionManager.toXClass( proxy.proxyClass() ); } } } else { lazy = true; //needed to allow association lazy loading. proxyClass = annotatedClass; } }
public static String getReferenceEntityName(PropertyData propertyData, XClass targetEntity, ExtendedMappings mappings) { if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
private XClass getCollectionType() { if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { if ( collectionType != null ) { return collectionType; } else { String errorMsg = "Collection has neither generic type or OneToMany.targetEntity() defined: " + safeCollectionRole(); throw new AnnotationException( errorMsg ); } } else { return targetEntity; } }
public static String getReferenceEntityName(PropertyData propertyData, ExtendedMappings mappings) { XClass targetEntity = getTargetEntity( propertyData, mappings ); if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
@SuppressWarnings({ "unchecked" }) public void setProxy(Proxy proxy) { if ( proxy != null ) { lazy = proxy.lazy(); if ( !lazy ) { proxyClass = null; } else { if ( AnnotationBinder.isDefault( mappings.getReflectionManager().toXClass( proxy.proxyClass() ), mappings ) ) { proxyClass = annotatedClass; } else { proxyClass = mappings.getReflectionManager().toXClass( proxy.proxyClass() ); } } } else { lazy = true; //needed to allow association lazy loading. proxyClass = annotatedClass; } }
public static String getReferenceEntityName(PropertyData propertyData, XClass targetEntity, Mappings mappings) { if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
public static String getReferenceEntityName(PropertyData propertyData, XClass targetEntity, Mappings mappings) { if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
public static String getReferenceEntityName(PropertyData propertyData, XClass targetEntity, MetadataBuildingContext buildingContext) { if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
private XClass getCollectionType() { if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { if ( collectionType != null ) { return collectionType; } else { String errorMsg = "Collection has neither generic type or OneToMany.targetEntity() defined: " + safeCollectionRole(); throw new AnnotationException( errorMsg ); } } else { return targetEntity; } }
private XClass getCollectionType() { if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { if ( collectionType != null ) { return collectionType; } else { String errorMsg = "Collection has neither generic type or OneToMany.targetEntity() defined: " + safeCollectionRole(); throw new AnnotationException( errorMsg ); } } else { return targetEntity; } }
private XClass getCollectionType() { if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) { if ( collectionType != null ) { return collectionType; } else { String errorMsg = "Collection has neither generic type or OneToMany.targetEntity() defined: " + safeCollectionRole(); throw new AnnotationException( errorMsg ); } } else { return targetEntity; } }
public static String getReferenceEntityName(PropertyData propertyData, MetadataBuildingContext buildingContext) { XClass targetEntity = getTargetEntity( propertyData, buildingContext ); if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
public static String getReferenceEntityName(PropertyData propertyData, Mappings mappings) { XClass targetEntity = getTargetEntity( propertyData, mappings ); if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
public static String getReferenceEntityName(PropertyData propertyData, Mappings mappings) { XClass targetEntity = getTargetEntity( propertyData, mappings ); if ( AnnotationBinder.isDefault( targetEntity, mappings ) ) { return propertyData.getClassOrElementName(); } else { return targetEntity.getName(); } }
public static void bindQuery(org.hibernate.annotations.NamedQuery queryAnn, ExtendedMappings mappings) { if ( queryAnn == null ) return; if ( BinderHelper.isDefault( queryAnn.name() ) ) { throw new AnnotationException( "A named query must have a name when used in class or package level" ); } FlushMode flushMode; flushMode = getFlushMode( queryAnn.flushMode() ); NamedQueryDefinition query = new NamedQueryDefinition( queryAnn.query(), queryAnn.cacheable(), BinderHelper.isDefault( queryAnn.cacheRegion() ) ? null : queryAnn.cacheRegion(), queryAnn.timeout() < 0 ? null : queryAnn.timeout(), queryAnn.fetchSize() < 0 ? null : queryAnn.fetchSize(), flushMode, getCacheMode( queryAnn.cacheMode() ), queryAnn.readOnly(), BinderHelper.isDefault( queryAnn.comment() ) ? null : queryAnn.comment(), null ); mappings.addQuery( queryAnn.name(), query ); if ( log.isInfoEnabled() ) log.info( "Binding named query: " + queryAnn.name() + " => " + queryAnn.query() ); }
public SimpleValue fillSimpleValue(SimpleValue simpleValue) { String type = BinderHelper.isDefault( explicitType ) ? returnedClassName : explicitType; org.hibernate.mapping.TypeDef typeDef = mappings.getTypeDef( type ); if ( typeDef != null ) { type = typeDef.getTypeClass(); simpleValue.setTypeParameters( typeDef.getParameters() ); } if ( typeParameters != null && typeParameters.size() != 0 ) { //explicit type params takes precedence over type def params simpleValue.setTypeParameters( typeParameters ); } simpleValue.setTypeName( type ); if ( persistentClassName != null ) { simpleValue.setTypeUsingReflection( persistentClassName, propertyName ); } for ( Ejb3Column column : columns ) { column.linkWithValue( simpleValue ); } return simpleValue; } }
public void setJoinAnnotation(JoinColumn annJoin, String defaultName) { if ( annJoin == null ) { setImplicit( true ); } else { setImplicit( false ); if ( ! BinderHelper.isDefault( annJoin.columnDefinition() ) ) setSqlType( annJoin.columnDefinition() ); if ( ! BinderHelper.isDefault( annJoin.name() ) ) setLogicalColumnName( annJoin.name() ); setNullable( annJoin.nullable() ); setUnique( annJoin.unique() ); setInsertable( annJoin.insertable() ); setUpdatable( annJoin.updatable() ); setReferencedColumn( annJoin.referencedColumnName() ); setSecondaryTableName( annJoin.table() ); } }