1 23 24 27 28 package com.sun.jdo.spi.persistence.support.sqlstore.state; 29 30 import com.sun.jdo.spi.persistence.utility.I18NHelper; 31 import com.sun.jdo.spi.persistence.support.sqlstore.ActionDesc; 32 33 import java.util.ResourceBundle ; 34 35 public class AutoPersistentNew extends LifeCycleState { 36 39 private final static ResourceBundle messages = I18NHelper.loadBundle( 40 "com.sun.jdo.spi.persistence.support.sqlstore.Bundle", AutoPersistentNew.class.getClassLoader()); 42 43 public AutoPersistentNew() { 44 isPersistent = true; 49 isPersistentInDataStore = false; 50 isAutoPersistent = true; 51 isTransactional = true; 52 isDirty = true; 53 isNew = true; 54 isDeleted = false; 55 isNavigable = false; 56 isRefreshable = false; 57 isBeforeImageUpdatable = false; 58 needsRegister = true; 59 needsReload = false; 60 needsRestoreOnRollback = true; 61 updateAction = ActionDesc.LOG_CREATE; 62 63 stateType = AP_NEW; 64 } 65 66 public LifeCycleState transitionMakePersistent() { 67 return changeState(P_NEW); 68 } 69 70 public LifeCycleState transitionDeletePersistent() { 71 return changeState(AP_NEW_DELETED); 72 } 73 74 public LifeCycleState transitionFlushed() { 75 return changeState(AP_NEW_FLUSHED); 76 } 77 78 public LifeCycleState transitionCommit(boolean retainValues) { 79 return changeState(TRANSIENT); 80 } 81 82 public LifeCycleState transitionRollback(boolean retainValues) { 83 return changeState(TRANSIENT); 84 } 85 86 public LifeCycleState transitionMakePending() { 87 return changeState(AP_NEW_PENDING); 88 } 89 90 public boolean needsRestoreOnRollback(boolean retainValues) { 91 return needsRestoreOnRollback; 96 } 97 } 98 99 100 101 102 103 104 105 106 107 108 | Popular Tags |