Example usage for org.hibernate.annotations Type type

List of usage examples for org.hibernate.annotations Type type

Introduction

In this page you can find the example usage for org.hibernate.annotations Type type.

Prototype

type

Source Link

Usage

From source file:org.projectforge.continuousdb.hibernate.TableAttributeHookImpl.java

License:Open Source License

/**
 * @see org.projectforge.continuousdb.TableAttributeHook#determineType(java.lang.reflect.AccessibleObject)
 *//*  ww w .j a  v a2 s.co m*/
@Override
public TableAttributeType determineType(final AccessibleObject annotatedFieldOrMethod) {
    if (annotatedFieldOrMethod.isAnnotationPresent(org.hibernate.annotations.Type.class)) {
        final org.hibernate.annotations.Type annotation = annotatedFieldOrMethod
                .getAnnotation(org.hibernate.annotations.Type.class);
        final String typePropertyValue = annotation.type();
        if ("binary".equals(typePropertyValue) == true) {
            return TableAttributeType.BINARY;
        } else if ("org.jadira.usertype.dateandtime.joda.PersistentPeriodAsString"
                .equals(typePropertyValue) == true) {
            return TableAttributeType.VARCHAR;
        } else if ("org.jadira.usertype.dateandtime.joda.PersistentDateTime"
                .equals(typePropertyValue) == true) {
            return TableAttributeType.TIMESTAMP;
        }
    }
    return null;
}