1 30 package com.genimen.djeneric.repository.rdbmsdirect; 31 32 import com.genimen.djeneric.repository.DjExtent; 33 import com.genimen.djeneric.repository.DjObject; 34 import com.genimen.djeneric.repository.rdbms.RdbmsExtent; 35 import com.genimen.djeneric.util.DjLogger; 36 37 47 48 public class RdbmsDirectExtent extends RdbmsExtent 49 { 50 public RdbmsDirectExtent(String objectType, String name, String alias, String internalCode, String title, 51 String nameSingular, String namePlural) 52 { 53 super(objectType, name, alias, internalCode, title, nameSingular, namePlural); 54 } 55 56 String _cachedSuperName = null; 57 58 65 66 protected String getTableName() 67 { 68 if (_cachedSuperName != null) return _cachedSuperName; 69 70 if (getSuper() == null) _cachedSuperName = getName(); 71 else 72 { 73 DjExtent superExtent = getSuper(); 74 while (superExtent.getSuper() != null) 75 superExtent = superExtent.getSuper(); 76 _cachedSuperName = superExtent.getName(); 77 } 78 return _cachedSuperName; 79 } 80 81 Boolean _usesTypeColumn = null; 85 86 public boolean multipleTypesInExtent() 87 { 88 if (_usesTypeColumn != null) return _usesTypeColumn.booleanValue(); 89 _usesTypeColumn = new Boolean (isPartOfInheritanceChain()); 90 return _usesTypeColumn.booleanValue(); 91 } 92 93 98 public Object clone() 99 { 100 RdbmsDirectExtent nt = new RdbmsDirectExtent(getObjectType(), getName(), getAlias(), getInternalCode(), getTitle(), 101 getNameSingular(), getNamePlural()); 102 nt.setInternalId(getInternalId()); 103 104 try 105 { 106 copyPropertiesInto(nt); 107 } 108 catch (Exception x) 109 { 110 DjLogger.log(x); 111 throw new RuntimeException ("Internal error: RdbmsDirectExtent.clone() failed"); 112 } 113 114 return nt; 115 } 116 117 } | Popular Tags |