Browse Source

Add setId(Long) back into class, as Hibernate 3.0.5 gives Lazy Initialization Exception if using field="access" when trying to do a getId() on a lazily loaded association.

Ben Alex 20 năm trước cách đây
mục cha
commit
be578c99d1

+ 15 - 0
domain/src/main/java/org/acegisecurity/domain/impl/PersistableEntityLong.java

@@ -30,6 +30,21 @@ public abstract class PersistableEntityLong extends AbstractPersistableEntity {
 
     //~ Methods ================================================================
 
+
+    /**
+     * DO NOT USE DIRECTLY.
+     * 
+     * <p>
+     * Typically only used by the persistence layer, but provided with public
+     * visibility to not limit flexibility.
+     * </p>
+     *
+     * @param id the new instance identity
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+    
     /**
      * Obtains the persistence identity of this instance.
      */