01: package org.hibernate.intercept;
02:
03: import org.hibernate.engine.SessionImplementor;
04:
05: /**
06: * Contract for field interception handlers.
07: *
08: * @author Steve Ebersole
09: */
10: public interface FieldInterceptor {
11:
12: /**
13: * Use to associate the entity to which we are bound to the given session.
14: *
15: * @param session The session to which we are now associated.
16: */
17: public void setSession(SessionImplementor session);
18:
19: /**
20: * Is the entity to which we are bound completely initialized?
21: *
22: * @return True if the entity is initialized; otherwise false.
23: */
24: public boolean isInitialized();
25:
26: /**
27: * The the given field initialized for the entity to which we are bound?
28: *
29: * @param field The name of the field to check
30: * @return True if the given field is initialized; otherwise false.
31: */
32: public boolean isInitialized(String field);
33:
34: /**
35: * Forcefully mark the entity as being dirty.
36: */
37: public void dirty();
38:
39: /**
40: * Is the entity considered dirty?
41: *
42: * @return True if the entity is dirty; otherwise false.
43: */
44: public boolean isDirty();
45:
46: /**
47: * Clear the internal dirty flag.
48: */
49: public void clearDirty();
50: }
|