~ubuntu-branches/ubuntu/wily/libhibernate3-java/wily-proposed

« back to all changes in this revision

Viewing changes to src/org/hibernate/intercept/LazyPropertyInitializer.java

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-10-14 14:43:34 UTC
  • Revision ID: james.westby@ubuntu.com-20071014144334-eamc8i0q10gs1aro
Tags: upstream-3.2.5
ImportĀ upstreamĀ versionĀ 3.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//$Id: LazyPropertyInitializer.java 9210 2006-02-03 22:15:19Z steveebersole $
 
2
package org.hibernate.intercept;
 
3
 
 
4
import java.io.Serializable;
 
5
 
 
6
import org.hibernate.HibernateException;
 
7
import org.hibernate.engine.SessionImplementor;
 
8
 
 
9
/**
 
10
 * Contract for controlling how lazy properties get initialized.
 
11
 * 
 
12
 * @author Gavin King
 
13
 */
 
14
public interface LazyPropertyInitializer {
 
15
 
 
16
        /**
 
17
         * Marker value for uninitialized properties
 
18
         */
 
19
        public static final Serializable UNFETCHED_PROPERTY = new Serializable() {
 
20
                public String toString() {
 
21
                        return "<lazy>";
 
22
                }
 
23
                public Object readResolve() {
 
24
                        return UNFETCHED_PROPERTY;
 
25
                }
 
26
        };
 
27
 
 
28
        /**
 
29
         * Initialize the property, and return its new value
 
30
         */
 
31
        public Object initializeLazyProperty(String fieldName, Object entity, SessionImplementor session)
 
32
        throws HibernateException;
 
33
 
 
34
}