1 29 30 package com.caucho.amber.entity; 31 32 import com.caucho.amber.manager.AmberConnection; 33 import com.caucho.amber.type.EntityType; 34 35 import java.sql.PreparedStatement ; 36 import java.sql.ResultSet ; 37 import java.sql.SQLException ; 38 import java.util.Map ; 39 40 43 public interface Entity { 44 public static final int TRANSIENT = 0; 45 public static final int P_NEW = 1; 46 public static final int P_NON_TRANSACTIONAL = 2; 47 public static final int P_TRANSACTIONAL = 3; 48 public static final int P_DELETING = 4; 49 public static final int P_DELETED = 5; 50 51 54 public boolean __caucho_makePersistent(AmberConnection aConn, 55 EntityType entityType) 56 throws SQLException ; 57 58 61 public void __caucho_makePersistent(AmberConnection aConn, 62 EntityItem item) 63 throws SQLException ; 64 65 68 public void __caucho_cascadePrePersist(AmberConnection aConn) 69 throws SQLException ; 70 71 74 public void __caucho_cascadePreRemove(AmberConnection aConn) 75 throws SQLException ; 76 77 80 public void __caucho_cascadePostPersist(AmberConnection aConn) 81 throws SQLException ; 82 83 86 public void __caucho_cascadePostRemove(AmberConnection aConn) 87 throws SQLException ; 88 89 92 public void __caucho_detach(); 93 94 97 public boolean __caucho_create(AmberConnection aConn, 98 EntityType entityType) 99 throws SQLException ; 100 101 104 public void __caucho_setPrimaryKey(Object key); 105 106 109 public Object __caucho_getPrimaryKey(); 110 111 114 public EntityType __caucho_getEntityType(); 115 116 119 public int __caucho_getEntityState(); 120 121 124 public void __caucho_setConnection(AmberConnection aConn); 125 126 129 public AmberConnection __caucho_getConnection(); 130 131 134 public boolean __caucho_match(String className, Object key); 135 136 139 public EntityItem __caucho_home_find(AmberConnection aConn, 140 AmberEntityHome home, 141 ResultSet rs, int index) 142 throws SQLException ; 143 144 147 public Entity __caucho_home_new(AmberConnection aConn, 148 AmberEntityHome home, 149 Object key) 150 throws SQLException ; 151 152 155 public Entity __caucho_home_new(AmberConnection aConn, 156 AmberEntityHome home, 157 Object key, 158 boolean loadFromResultSet) 159 throws SQLException ; 160 161 164 public Entity __caucho_copy(AmberConnection aConn, EntityItem cacheItem); 165 166 169 public void __caucho_retrieve(AmberConnection aConn) 170 throws SQLException ; 171 172 175 public void __caucho_retrieve(AmberConnection aConn, Map preloadedProperties) 176 throws SQLException ; 177 178 183 public int __caucho_load(AmberConnection aConn, ResultSet rs, int index) 184 throws SQLException ; 185 186 189 public void __caucho_setKey(PreparedStatement pstmt, int index) 190 throws SQLException ; 191 192 195 public void __caucho_expire(); 196 197 200 public void __caucho_delete(); 201 202 205 public void __caucho_invalidate_foreign(String table, Object key); 206 207 210 public boolean __caucho_flush() 211 throws SQLException ; 212 213 216 public void __caucho_afterCommit(); 217 218 221 public void __caucho_afterRollback(); 222 223 226 } 228 | Popular Tags |