app/src/main/java/db/juhaku/juhakudb/core/NameResolver.java
/**
     * Resolves id field's name for class of Entity.
     * @param type Class<?> to provide for id field resolving.
     * @return Returns found name.
     * @throws NameResolveException if name is not found, or required annotations is not found.
     *
     * @since 1.0.2
     */
Resolves id field's name for class of Entity.
@param type Class to provide for id field resolving.
@return Returns found name.
@throws NameResolveException if name is not found, or required annotations is not found.


Resolves id field ' s name for class of Entity . @param type Class to provide for id field resolving . @return Returns found name . @throws NameResolveException if name is not found or required annotations is not found .
public static final String resolveIdName(Class<?> type) throws NameResolveException {
        if (type.isAnnotationPresent(Entity.class)) {
            for (Field field : type.getDeclaredFields()) {
                field.setAccessible(true);
                if (field.isAnnotationPresent(Id.class)) {
                    return ID_FIELD_SUFFIX;
                }
            }
        }
        throw new NameResolveException("Annotation (" + Entity.class.getName() + ", "
                + Id.class.getName() + " and " + Column.class.getName()
                + " not found, or name was empty in " + Column.class.getName() + " annotation");
    }
public static final String resolveIdName ( Class < ? > type ) throws NameResolveException { if ( type . isAnnotationPresent ( Entity . class ) ) { for ( Field field : type . getDeclaredFields ( ) ) { field . setAccessible ( true ) ; if ( field . isAnnotationPresent ( Id . class ) ) { return ID_FIELD_SUFFIX ; } } } throw new NameResolveException ( "Annotation (" + Entity . class . getName ( ) + ", " + Id . class . getName ( ) + " and " + Column . class . getName ( ) + " not found, or name was empty in " + Column . class . getName ( ) + " annotation" ) ; }
Resolves id field's name for class of Entity.
Resolves id field ' s name for class of Entity .