Search in sources :

Example 1 with DataEntry

use of io.jans.orm.annotation.DataEntry in project jans by JanssenProject.

the class BaseEntryManager method isUseEntryForceUpdate.

protected boolean isUseEntryForceUpdate(Class<?> entryClass) {
    if (!isSupportForceUpdate()) {
        return false;
    }
    if (entryClass == null) {
        throw new MappingException("Entry class is null");
    }
    // Check if entry is LDAP Entry
    List<Annotation> entryAnnotations = ReflectHelper.getClassAnnotations(entryClass, LDAP_ENTRY_TYPE_ANNOTATIONS);
    Annotation dataEntry = ReflectHelper.getAnnotationByType(entryAnnotations, DataEntry.class);
    if (dataEntry == null) {
        return false;
    }
    return ((DataEntry) dataEntry).forceUpdate();
}
Also used : DataEntry(io.jans.orm.annotation.DataEntry) PropertyAnnotation(io.jans.orm.reflect.property.PropertyAnnotation) Annotation(java.lang.annotation.Annotation) MappingException(io.jans.orm.exception.MappingException)

Example 2 with DataEntry

use of io.jans.orm.annotation.DataEntry in project jans by JanssenProject.

the class BaseEntryManager method isConfigurationEntry.

protected boolean isConfigurationEntry(Class<?> entryClass) {
    if (entryClass == null) {
        throw new MappingException("Entry class is null");
    }
    // Check if entry is LDAP Entry
    List<Annotation> entryAnnotations = ReflectHelper.getClassAnnotations(entryClass, LDAP_ENTRY_TYPE_ANNOTATIONS);
    DataEntry dataEntry = (DataEntry) ReflectHelper.getAnnotationByType(entryAnnotations, DataEntry.class);
    if (dataEntry == null) {
        return false;
    }
    return dataEntry.configurationDefinition();
}
Also used : DataEntry(io.jans.orm.annotation.DataEntry) PropertyAnnotation(io.jans.orm.reflect.property.PropertyAnnotation) Annotation(java.lang.annotation.Annotation) MappingException(io.jans.orm.exception.MappingException)

Example 3 with DataEntry

use of io.jans.orm.annotation.DataEntry in project jans by JanssenProject.

the class BaseEntryManager method getEntrySortByProperties.

protected String[] getEntrySortByProperties(Class<?> entryClass) {
    if (entryClass == null) {
        throw new MappingException("Entry class is null");
    }
    // Check if entry is LDAP Entry
    List<Annotation> entryAnnotations = ReflectHelper.getClassAnnotations(entryClass, LDAP_ENTRY_TYPE_ANNOTATIONS);
    Annotation annotation = ReflectHelper.getAnnotationByType(entryAnnotations, DataEntry.class);
    if (annotation == null) {
        return null;
    }
    return ((DataEntry) annotation).sortBy();
}
Also used : DataEntry(io.jans.orm.annotation.DataEntry) PropertyAnnotation(io.jans.orm.reflect.property.PropertyAnnotation) Annotation(java.lang.annotation.Annotation) MappingException(io.jans.orm.exception.MappingException)

Example 4 with DataEntry

use of io.jans.orm.annotation.DataEntry in project jans by JanssenProject.

the class BaseEntryManager method getEntrySortByNames.

protected String[] getEntrySortByNames(Class<?> entryClass) {
    if (entryClass == null) {
        throw new MappingException("Entry class is null");
    }
    // Check if entry is LDAP Entry
    List<Annotation> entryAnnotations = ReflectHelper.getClassAnnotations(entryClass, LDAP_ENTRY_TYPE_ANNOTATIONS);
    Annotation annotation = ReflectHelper.getAnnotationByType(entryAnnotations, DataEntry.class);
    if (annotation == null) {
        return null;
    }
    return ((DataEntry) annotation).sortByName();
}
Also used : DataEntry(io.jans.orm.annotation.DataEntry) PropertyAnnotation(io.jans.orm.reflect.property.PropertyAnnotation) Annotation(java.lang.annotation.Annotation) MappingException(io.jans.orm.exception.MappingException)

Aggregations

DataEntry (io.jans.orm.annotation.DataEntry)4 MappingException (io.jans.orm.exception.MappingException)4 PropertyAnnotation (io.jans.orm.reflect.property.PropertyAnnotation)4 Annotation (java.lang.annotation.Annotation)4