Java Code Examples for org.hibernate.FetchMode#DEFAULT

The following examples show how to use org.hibernate.FetchMode#DEFAULT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GrailsHibernateQueryUtils.java    From gorm-hibernate5 with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieves the fetch mode for the specified instance; otherwise returns the default FetchMode.
 *
 * @param object The object, converted to a string
 * @return The FetchMode
 */
public static FetchMode getFetchMode(Object object) {
    String name = object != null ? object.toString() : "default";
    if (name.equalsIgnoreCase(FetchMode.JOIN.toString()) || name.equalsIgnoreCase("eager")) {
        return FetchMode.JOIN;
    }
    if (name.equalsIgnoreCase(FetchMode.SELECT.toString()) || name.equalsIgnoreCase("lazy")) {
        return FetchMode.SELECT;
    }
    return FetchMode.DEFAULT;
}
 
Example 2
Source File: CriteriaJoinWalker.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private static boolean isDefaultFetchMode(FetchMode fetchMode) {
	return fetchMode == null || fetchMode == FetchMode.DEFAULT;
}
 
Example 3
Source File: CompositeCustomType.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public FetchMode getFetchMode(int i) {
	return FetchMode.DEFAULT;
}
 
Example 4
Source File: CriteriaJoinWalker.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
private static boolean isDefaultFetchMode(FetchMode fetchMode) {
	return fetchMode==null || fetchMode==FetchMode.DEFAULT;
}
 
Example 5
Source File: CompositeCustomType.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public FetchMode getFetchMode(int i) {
	return FetchMode.DEFAULT;
}