/** * Create a new class to be mapped to a table. The class will start out * with a default application identity class set. */ public ClassMapping newClassMapping(Class cls, Table table) { ClassMapping mapping = (ClassMapping) getRepository().addMetaData(cls); Class sup = mapping.getDescribedType().getSuperclass(); if (sup == Object.class) setObjectIdType(mapping); else mapping.setPCSuperclass(sup); mapping.setTable(table); if (_detachable) mapping.setDetachable(true); _tables.put(table, mapping); return mapping; }
/** * Create a new class to be mapped to a table. The class will start out * with a default application identity class set. */ public ClassMapping newClassMapping(Class cls, Table table) { ClassMapping mapping = (ClassMapping) getRepository().addMetaData(cls); Class sup = mapping.getDescribedType().getSuperclass(); if (sup == Object.class) setObjectIdType(mapping); else mapping.setPCSuperclass(sup); mapping.setTable(table); if (_detachable) mapping.setDetachable(true); _tables.put(table, mapping); return mapping; }
/** * Create a new class to be mapped to a table. The class will start out * with a default application identity class set. */ public ClassMapping newClassMapping(Class cls, Table table) { ClassMapping mapping = (ClassMapping) getRepository().addMetaData(cls); Class sup = mapping.getDescribedType().getSuperclass(); if (sup == Object.class) setObjectIdType(mapping); else mapping.setPCSuperclass(sup); mapping.setTable(table); if (_detachable) mapping.setDetachable(true); _tables.put(table, mapping); return mapping; }
/** * Create a new class to be mapped to a table. The class will start out * with a default application identity class set. */ public ClassMapping newClassMapping(Class cls, Table table) { ClassMapping mapping = (ClassMapping) getRepository().addMetaData(cls); Class sup = mapping.getDescribedType().getSuperclass(); if (sup == Object.class) setObjectIdType(mapping); else mapping.setPCSuperclass(sup); mapping.setTable(table); if (_detachable) mapping.setDetachable(true); _tables.put(table, mapping); return mapping; }
/** * Create a new class to be mapped to a table. The class will start out * with a default application identity class set. */ public ClassMapping newClassMapping(Class cls, Table table) { ClassMapping mapping = (ClassMapping) getRepository().addMetaData(cls); Class sup = mapping.getDescribedType().getSuperclass(); if (sup == Object.class) setObjectIdType(mapping); else mapping.setPCSuperclass(sup); mapping.setTable(table); if (_detachable) mapping.setDetachable(true); _tables.put(table, mapping); return mapping; }
/** * Create a metadata for the given instance. */ private void addMeta(Class<?> cls) { if (cls == null) return; _flush = true; MappingRepository repos = getRepository(); repos.setResolve(MODE_MAPPING, false); MetaDataFactory factory = repos.getMetaDataFactory(); factory.getDefaults().setIgnoreNonPersistent(false); factory.setStoreMode(MetaDataFactory.STORE_VERBOSE); ClassMetaData meta = repos.addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "": _file.getPath() ); meta.setResolve(MODE_META, true); }
/** * Create a metadata for the given instance. */ private void addMeta(Class<?> cls) { if (cls == null) return; _flush = true; MappingRepository repos = getRepository(); repos.setResolve(MODE_MAPPING, false); MetaDataFactory factory = repos.getMetaDataFactory(); factory.getDefaults().setIgnoreNonPersistent(false); factory.setStoreMode(MetaDataFactory.STORE_VERBOSE); ClassMetaData meta = repos.addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "": _file.getPath() ); meta.setResolve(MODE_META, true); }
/** * Create a metadata for the given instance. */ private void addMeta(Class<?> cls) { if (cls == null) return; _flush = true; MappingRepository repos = getRepository(); repos.setResolve(MODE_MAPPING, false); MetaDataFactory factory = repos.getMetaDataFactory(); factory.getDefaults().setIgnoreNonPersistent(false); factory.setStoreMode(MetaDataFactory.STORE_VERBOSE); ClassMetaData meta = repos.addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "": _file.getPath() ); meta.setResolve(MODE_META, true); }
/** * Create a metadata for the given instance. */ private void addMeta(Class<?> cls) { if (cls == null) return; _flush = true; MappingRepository repos = getRepository(); repos.setResolve(MODE_MAPPING, false); MetaDataFactory factory = repos.getMetaDataFactory(); factory.getDefaults().setIgnoreNonPersistent(false); factory.setStoreMode(MetaDataFactory.STORE_VERBOSE); ClassMetaData meta = repos.addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "": _file.getPath() ); meta.setResolve(MODE_META, true); }
/** * Create a metadata for the given instance. */ private void addMeta(Class cls) { if (cls == null) return; _flush = true; MappingRepository repos = getRepository(); repos.setResolve(MODE_MAPPING, false); MetaDataFactory factory = repos.getMetaDataFactory(); factory.getDefaults().setIgnoreNonPersistent(false); factory.setStoreMode(MetaDataFactory.STORE_VERBOSE); ClassMetaData meta = repos.addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType()); meta.setResolve(MODE_META, true); }