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 PersistentNew extends LifeCycleState { 36 39 private final static ResourceBundle messages = I18NHelper.loadBundle( 40 "com.sun.jdo.spi.persistence.support.sqlstore.Bundle", PersistentNew.class.getClassLoader()); 42 43 public PersistentNew() { 44 isPersistent = true; 49 isPersistentInDataStore = false; 50 isTransactional = true; 51 isDirty = true; 52 isNew = true; 53 isDeleted = false; 54 isNavigable = false; 55 isRefreshable = false; 56 isBeforeImageUpdatable = false; 57 needsRegister = true; 58 needsReload = false; 59 needsRestoreOnRollback = true; 60 updateAction = ActionDesc.LOG_CREATE; 61 62 stateType = P_NEW; 63 } 64 65 66 public LifeCycleState transitionDeletePersistent() { 67 return changeState(P_NEW_DELETED); 68 } 69 70 71 public LifeCycleState transitionFlushed() { 72 return changeState(P_NEW_FLUSHED); 73 } 74 75 public LifeCycleState transitionCommit(boolean retainValues) { 76 if (retainValues) { 77 return changeState(P_NON_TX); 78 } else { 79 return changeState(HOLLOW); 80 } 81 } 82 83 public LifeCycleState transitionRollback(boolean retainValues) { 84 return changeState(TRANSIENT); 85 } 86 87 public boolean needsRestoreOnRollback(boolean retainValues) { 88 return needsRestoreOnRollback; 93 } 94 } 95 96 97 98 99 100 101 102 103 104 105 | Popular Tags |