app/src/main/java/db/juhaku/juhakudb/core/android/transaction/QueryTransactionTemplate.java
/**
     * Check is cascade allowed to fetched entity. This is determined if at least 2 fields has value
     * in the entity. Currently this is only way to know that because id for entity might be filled
     * without it being fetched from database.
     *
     * @param entity Object entity to check whether cascading is allowed for it.
     * @return Boolean value true if cascading is allowed for the entity; false otherwise.
     *
     * @since 2.1.1
     *
     * @hide
     */
Check is cascade allowed to fetched entity. This is determined if at least 2 fields has value
in the entity. Currently this is only way to know that because id for entity might be filled
without it being fetched from database.

@param entity Object entity to check whether cascading is allowed for it.
@return Boolean value true if cascading is allowed for the entity; false otherwise.



@hide
Check is cascade allowed to fetched entity . This is determined if at least 2 fields has value in the entity . Currently this is only way to know that because id for entity might be filled without it being fetched from database . @param entity Object entity to check whether cascading is allowed for it . @return Boolean value true if cascading is allowed for the entity ; false otherwise . @hide
private static <T> boolean allowCascadingToFetchElements(T entity) {
        int hasValue = 0;
        for (Field field : entity.getClass().getDeclaredFields()) {
            Object value = ReflectionUtils.getFieldValue(field.getName(), entity);
            if (value != null) {
                hasValue++;
                if (hasValue == 2) {
                    break;
                }
            }
        }
        return hasValue == 2;
    }
private static < T > boolean allowCascadingToFetchElements ( T entity ) { int hasValue = 0 ; for ( Field field : entity . getClass ( ) . getDeclaredFields ( ) ) { Object value = ReflectionUtils . getFieldValue ( field . getName ( ) , entity ) ; if ( value != null ) { hasValue ++ ; if ( hasValue == 2 ) { break ; } } } return hasValue == 2 ; }
Check is cascade allowed to fetched entity.
Check is cascade allowed to fetched entity .