@Override protected Integer fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.SECONDS; return (int) unit.toSeconds(timeout); } }
AnnotationValue httpConstraintERSValue = httpConstraint.value(); if (httpConstraintERSValue != null) { servletSecurity.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(httpConstraintERSValue.asEnum())); servletSecurity.setTransportGuarantee(TransportGuaranteeType.valueOf(httpConstraintTGValue.asEnum())); methodConstraint.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(httpMethodConstraintERSValue.asEnum())); methodConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(httpMethodConstraintTGValue.asEnum()));
@Override protected ConcurrencyManagementType fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final AnnotationValue value = annotationInstance.value(); if(value == null) { return ConcurrencyManagementType.CONTAINER; } return ConcurrencyManagementType.valueOf(value.asEnum()); } }
@Override protected TransactionAttributeType fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final AnnotationValue value = annotationInstance.value(); if(value == null) { return TransactionAttributeType.REQUIRED; } return TransactionAttributeType.valueOf(value.asEnum()); } }
@Override protected TransactionManagementType fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final AnnotationValue value = annotationInstance.value(); if(value == null) { return TransactionManagementType.CONTAINER; } return TransactionManagementType.valueOf(value.asEnum()); } }
@Override protected LockType fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { AnnotationValue value = annotationInstance.value(); if(value == null) { return LockType.WRITE; } return LockType.valueOf(annotationInstance.value().asEnum()); } }
@Override protected AccessTimeoutDetails fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.MILLISECONDS; return new AccessTimeoutDetails(timeout, unit); } }
@Override protected StatefulTimeoutInfo fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final long value = annotationInstance.value().asLong(); final AnnotationValue unitValue = annotationInstance.value("unit"); final TimeUnit unit; if (unitValue != null) { unit = TimeUnit.valueOf(unitValue.asEnum()); } else { unit = TimeUnit.MINUTES; } return new StatefulTimeoutInfo(value, unit); } }
public String[] asEnumArray() { int length = value.length; String[] array = new String[length]; for (int i = 0; i < length; i++) { array[i] = value[i].asEnum(); } return array; }
private boolean determineFetchType(AnnotationInstance associationAnnotation) { boolean lazy = false; AnnotationValue fetchValue = associationAnnotation.value( "fetch" ); if ( fetchValue != null ) { FetchType fetchType = Enum.valueOf( FetchType.class, fetchValue.asEnum() ); if ( FetchType.LAZY.equals( fetchType ) ) { lazy = true; } } return lazy; }
private boolean determineFetchType(AnnotationInstance associationAnnotation) { boolean lazy = false; AnnotationValue fetchValue = associationAnnotation.value( "fetch" ); if ( fetchValue != null ) { FetchType fetchType = Enum.valueOf( FetchType.class, fetchValue.asEnum() ); if ( FetchType.LAZY.equals( fetchType ) ) { lazy = true; } } return lazy; }
@Override protected TransactionAttributeType fromAnnotation(final AnnotationInstance annotationInstance) { final AnnotationValue value = annotationInstance.value(); if(value == null) { return TransactionAttributeType.REQUIRED; } return TransactionAttributeType.valueOf(value.asEnum()); } }
@Override protected TransactionManagementType fromAnnotation(final AnnotationInstance annotationInstance) { final AnnotationValue value = annotationInstance.value(); if(value == null) { return TransactionManagementType.CONTAINER; } return TransactionManagementType.valueOf(value.asEnum()); } }
@Override protected ConcurrencyManagementType fromAnnotation(final AnnotationInstance annotationInstance) { final AnnotationValue value = annotationInstance.value(); if(value == null) { return ConcurrencyManagementType.CONTAINER; } return ConcurrencyManagementType.valueOf(value.asEnum()); } }
@Override protected Integer fromAnnotation(final AnnotationInstance annotationInstance) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.SECONDS; return (int) unit.toSeconds(timeout); } }
@Override protected AccessTimeoutDetails fromAnnotation(final AnnotationInstance annotationInstance) { final long timeout = annotationInstance.value().asLong(); AnnotationValue unitAnnVal = annotationInstance.value("unit"); final TimeUnit unit = unitAnnVal != null ? TimeUnit.valueOf(unitAnnVal.asEnum()) : TimeUnit.MILLISECONDS; return new AccessTimeoutDetails(timeout, unit); } }
@Override protected StatefulTimeoutInfo fromAnnotation(final AnnotationInstance annotationInstance) { final long value = annotationInstance.value().asLong(); final AnnotationValue unitValue = annotationInstance.value("unit"); final TimeUnit unit; if (unitValue != null) { unit = TimeUnit.valueOf(unitValue.asEnum()); } else { unit = TimeUnit.MINUTES; } return new StatefulTimeoutInfo(value, unit); } }
@Override protected LockType fromAnnotation(final AnnotationInstance annotationInstance) { AnnotationValue value = annotationInstance.value(); if(value == null) { return LockType.WRITE; } return LockType.valueOf(annotationInstance.value().asEnum()); } }
private boolean ignoreNotFound() { NotFoundAction action = NotFoundAction.EXCEPTION; AnnotationInstance notFoundAnnotation = JandexHelper.getSingleAnnotation( annotations(), HibernateDotNames.NOT_FOUND ); if ( notFoundAnnotation != null ) { AnnotationValue actionValue = notFoundAnnotation.value( "action" ); if ( actionValue != null ) { action = Enum.valueOf( NotFoundAction.class, actionValue.asEnum() ); } } return NotFoundAction.IGNORE.equals( action ); }
private CustomSQL createCustomSQL(AnnotationInstance customSqlAnnotation) { if ( customSqlAnnotation == null ) { return null; } final String sql = customSqlAnnotation.value( "sql" ).asString(); final boolean isCallable = customSqlAnnotation.value( "callable" ) != null && customSqlAnnotation.value( "callable" ).asBoolean(); final ExecuteUpdateResultCheckStyle checkStyle = customSqlAnnotation.value( "check" ) == null ? isCallable ? ExecuteUpdateResultCheckStyle.NONE : ExecuteUpdateResultCheckStyle.COUNT : ExecuteUpdateResultCheckStyle.valueOf( customSqlAnnotation.value( "check" ).asEnum() ); return new CustomSQL( sql, isCallable, checkStyle ); }