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