1 10 11 package com.triactive.jdo.store; 12 13 14 class JDOBaseTable extends BaseTable implements JDOTable 15 { 16 protected final int tableID; 17 protected final String javaName; 18 19 private int nextHiValue = -1; 20 private int nextLoValue = -1; 21 22 23 JDOBaseTable(TableMetadata tmd, StoreManager storeMgr) 24 { 25 super(tmd.tableName, storeMgr); 26 27 this.tableID = tmd.tableID; 28 this.javaName = tmd.javaName; 29 } 30 31 32 public void initialize() 33 { 34 assertIsUninitialized(); 35 36 state = TABLE_STATE_INITIALIZED; 37 } 38 39 40 public int getTableID() 41 { 42 return tableID; 43 } 44 45 46 public String getJavaName() 47 { 48 return javaName; 49 } 50 51 52 public synchronized final OID newOID() 53 { 54 if (nextHiValue < 0) 55 { 56 nextHiValue = storeMgr.getNextOIDHiValue(tableID); 57 nextLoValue = 0; 58 } 59 60 OID id = new OID(tableID, nextHiValue, nextLoValue); 61 62 if (nextLoValue == OID.MAX_OBJIDLO) 63 nextHiValue = nextLoValue = -1; 64 else 65 ++nextLoValue; 66 67 return id; 68 } 69 } 70 | Popular Tags |