1 23 24 27 28 package com.sun.jdo.spi.persistence.support.sqlstore.state; 29 30 import com.sun.jdo.api.persistence.support.JDOUserException; 31 import com.sun.jdo.spi.persistence.utility.I18NHelper; 32 import com.sun.jdo.spi.persistence.support.sqlstore.ActionDesc; 33 34 import java.util.ResourceBundle ; 35 36 public class PersistentDeleted extends LifeCycleState { 37 40 private final static ResourceBundle messages = I18NHelper.loadBundle( 41 "com.sun.jdo.spi.persistence.support.sqlstore.Bundle", PersistentDeleted.class.getClassLoader()); 43 44 public PersistentDeleted() { 45 isPersistent = true; 50 isPersistentInDataStore = true; 51 isTransactional = true; 52 isDirty = true; 53 isNew = false; 54 isDeleted = true; 55 isNavigable = false; 56 isRefreshable = true; 57 isBeforeImageUpdatable = false; 58 needsRegister = true; 59 needsReload = false; 60 needsRestoreOnRollback = false; 61 updateAction = ActionDesc.LOG_DESTROY; 62 63 needMerge = false; 65 66 stateType = P_DELETED; 67 } 68 69 public LifeCycleState transitionCommit(boolean retainValues) { 70 return changeState(TRANSIENT); 71 } 72 73 public LifeCycleState transitionFlushed() { 74 return changeState(P_DELETED_FLUSHED); 75 } 76 77 public LifeCycleState transitionRefreshPersistent() { 78 return changeState(P_CLEAN); 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 transitionReadField(boolean optimisitic, boolean nontransactionalRead, 90 boolean transactionActive) { 91 throw new JDOUserException(I18NHelper.getMessage(messages, 93 "jdo.lifecycle.deleted.accessField")); } 95 96 public LifeCycleState transitionWriteField(boolean transactionActive) { 97 throw new JDOUserException(I18NHelper.getMessage(messages, 99 "jdo.lifecycle.deleted.accessField")); } 101 102 public LifeCycleState transitionRefresh() { 103 return changeState(P_CLEAN); 104 } 105 } 106 107 108 109 110 111 112 113 114 115 | Popular Tags |