1 23 24 package org.objectweb.jorm.api; 25 26 import org.objectweb.jorm.metainfo.api.MetaObject; 27 import org.objectweb.jorm.naming.api.PBinder; 28 import org.objectweb.jorm.naming.api.PExceptionNaming; 29 import org.objectweb.jorm.naming.api.PName; 30 import org.objectweb.jorm.naming.api.PNameCoder; 31 import org.objectweb.jorm.type.api.PExceptionTyping; 32 import org.objectweb.jorm.type.api.PType; 33 import org.objectweb.medor.tuple.api.TupleCollection; 34 35 import java.util.HashMap ; 36 import java.util.Iterator ; 37 38 49 public interface PClassMapping { 50 54 final static byte CLEANUP_REMOVEALL = 1; 55 59 final static byte CLEANUP_REMOVEDATA = 2; 60 64 final static byte CREATE_STRUCTURE_IF_NEEDED = 3; 65 69 final static byte CLEANUP_DONOTHING = 4; 70 71 76 PBinding createPBinding() throws PException; 77 78 86 void init(PMappingCallback mapper, MetaObject metaclass) 87 throws PException; 88 89 95 void init(PMappingStructuresManager pmsm) 96 throws PException; 97 98 103 void classDefined(PMappingStructuresManager pmsm) throws PException; 104 105 112 String getClassName(); 113 114 117 String getProjectName(); 118 119 126 PClassMapping getGenClassMapping() throws UnsupportedOperationException ; 127 128 136 PClassMapping getGenClassMapping(String fn) 137 throws UnsupportedOperationException ; 138 139 146 MetaObject getMetaInfo(); 147 148 153 PBinder getPBinder(); 154 155 160 PMapper getPMapper(); 161 162 175 PNameCoder getPNameCoder() 176 throws UnsupportedOperationException ; 177 178 187 PNameCoder getPNameCoder(String fn) 188 throws UnsupportedOperationException ; 189 190 194 PNameCoder getClassPNameCoder(); 195 196 212 PNameIterator getPNameIterator(Object conn, 213 boolean withSubType, 214 boolean prefetching, 215 Object txctx) throws PException; 216 217 220 Iterator getPNameIterator(Object conn) throws PException; 221 222 223 227 PType getPType(); 228 229 234 PClassMapping[] getSubPCMs() throws PException; 235 236 242 boolean isConform(String mappername); 243 244 254 void setPBinder(PBinder pb) throws PException; 255 256 270 void configureRefFields(ReferenceConfigurator rc) throws PException, UnsupportedOperationException ; 271 272 275 public interface ReferenceConfigurator { 276 284 PNameCoder getPNameCoder(String sourceclassName, 285 String refFieldName, 286 String destclassName); 287 288 296 PNameCoder getPNameCoder(String sourceclassName, 297 String refFieldName, 298 String [] genClassNames); 299 300 309 PClassMapping getGenClassMapping(String sourceclassName, 310 String refFieldName, 311 String [] genClassNames); 312 313 323 PClassMapping getGenClassMapping(String sourceclassName, 324 String refFieldName, 325 String [] genClassNames, 326 String destclassName); 327 } 328 329 342 boolean exist(PBinding pb, Object conn) throws PException; 343 344 357 void read(PBinding pb, Object conn, PAccessor pa) throws PException; 358 359 375 void read(PBinding pb, Object conn, PAccessor pa, Object txctx) throws PException; 376 377 396 void write(PBinding pb, Object conn, PAccessor pa) throws PException; 397 398 422 HashMap getAssociationTable(); 423 424 431 void addAssociation(PClassMapping targetClass, int[] indexes); 432 433 437 int[] getIndexesTable(PClassMapping targetClass); 438 439 443 PName resolve(Object conn, PName pname) throws PException; 444 445 449 boolean match(Object obj, boolean intermediaryTuple) throws PException; 450 451 455 PName getDecodedPName(TupleCollection tc, PName pname, boolean intermediaryTuple) throws PException; 456 } 457 | Popular Tags |