📄 fetchmode.java
字号:
//$Id: FetchMode.java,v 1.3 2003/06/15 12:45:04 oneovthafew Exp $package net.sf.hibernate;import java.io.Serializable;import java.util.HashMap;import java.util.Map;/** * Represents an association fetching strategy. This is used * together with the <tt>Criteria</tt> API to specify runtime * fetching strategies.<br> * <br> * For HQL queries, use the <tt>FETCH</tt> keyword instead. * * @see Criteria#setFetchMode(java.lang.String, FetchMode) * @author Gavin King */public final class FetchMode implements Serializable { private final int level; private final String name; private static final Map INSTANCES = new HashMap(); private FetchMode(int level, String name) { this.level=level; this.name=name; } public String toString() { return name; } /** * Fetch lazily. Equivalent to <tt>outer-join="false"</tt>. */ public static final FetchMode LAZY = new FetchMode(1, "LAZY"); /** * Fetch eagerly, using an outer join. Equivalent to * <tt>outer-join="true"</tt>. */ public static final FetchMode EAGER = new FetchMode(2, "EAGER"); /** * Default to the setting configured in the mapping file. */ public static final FetchMode DEFAULT = new FetchMode(0, "DEFAULT"); static { INSTANCES.put( new Integer(LAZY.level), LAZY ); INSTANCES.put( new Integer(EAGER.level), EAGER ); INSTANCES.put( new Integer(DEFAULT.level), DEFAULT ); } private Object readResolve() { return INSTANCES.get( new Integer(level) ); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -