/** * Return the least-derived metadata in the inheritance chain * above <code>meta</code>, or <code>meta</code> if it is a * least-derived metadata. */ private static ClassMetaData getLeastDerived(ClassMetaData meta) { while (meta.getPCSuperclass() != null) meta = meta.getPCSuperclassMetaData(); return meta; }
/** * Return whether the given class has any mapped persistent subclasses. */ private boolean hasSubclasses(ClassMapping cls) { ClassMetaData[] metas = repos.getMetaDatas(); for (int i = 0; i < metas.length; i++) if (metas[i].getPCSuperclass() == cls.getDescribedType()) return true; return false; } }
/** * Return the least-derived metadata in the inheritance chain * above <code>meta</code>, or <code>meta</code> if it is a * least-derived metadata. */ private static ClassMetaData getLeastDerived(ClassMetaData meta) { while (meta.getPCSuperclass() != null) meta = meta.getPCSuperclassMetaData(); return meta; }
/** * Return whether the given class has any mapped persistent subclasses. */ private boolean hasSubclasses(ClassMapping cls) { ClassMetaData[] metas = repos.getMetaDatas(); for (int i = 0; i < metas.length; i++) if (metas[i].getPCSuperclass() == cls.getDescribedType()) return true; return false; } }
public Object newDataStoreId(Object val, ClassMetaData meta) { // we use base types for all oids while (meta.getPCSuperclass() != null) meta = meta.getPCSuperclassMetaData(); return Id.newInstance(meta.getDescribedType(), val); }
/** * Return whether the given class has any mapped persistent subclasses. */ private boolean hasSubclasses(ClassMapping cls) { ClassMetaData[] metas = repos.getMetaDatas(); for (int i = 0; i < metas.length; i++) if (metas[i].getPCSuperclass() == cls.getDescribedType()) return true; return false; } }
public Object newDataStoreId(Object val, ClassMetaData meta) { // we use base types for all oids while (meta.getPCSuperclass() != null) meta = meta.getPCSuperclassMetaData(); return Id.newInstance(meta.getDescribedType(), val); }
/** * Return whether the given class has any mapped persistent subclasses. */ private boolean hasSubclasses(ClassMapping cls) { ClassMetaData[] metas = repos.getMetaDatas(); for (int i = 0; i < metas.length; i++) if (metas[i].getPCSuperclass() == cls.getDescribedType()) return true; return false; } }
public Object newDataStoreId(Object val, ClassMetaData meta) { // we use base types for all oids while (meta.getPCSuperclass() != null) meta = meta.getPCSuperclassMetaData(); return Id.newInstance(meta.getDescribedType(), val); }
/** * Return whether the given class has any mapped persistent subclasses. */ private boolean hasSubclasses(ClassMapping cls) { ClassMetaData[] metas = repos.getMetaDatas(); for (int i = 0; i < metas.length; i++) if (metas[i].getPCSuperclass() == cls.getDescribedType()) return true; return false; } }
public Object newDataStoreId(Object val, ClassMetaData meta) { // we use base types for all oids while (meta.getPCSuperclass() != null) meta = meta.getPCSuperclassMetaData(); return Id.newInstance(meta.getDescribedType(), val); }
/** * Return metadata for primary key fields declared in the given class. */ private static FieldMetaData[] getDeclaredPrimaryKeyFields (ClassMetaData meta) { if (meta.getPCSuperclass() == null) return meta.getPrimaryKeyFields(); // remove the primary key fields that are not declared // in the current class FieldMetaData[] fields = meta.getPrimaryKeyFields(); List decs = new ArrayList(fields.length); for (int i = 0; i < fields.length; i++) if (fields[i].getDeclaringType() == meta.getDescribedType()) decs.add(fields[i]); return (FieldMetaData[]) decs.toArray(new FieldMetaData[decs.size()]); }
public Object newDataStoreId(Object val, ClassMetaData meta) { // we use base types for all oids while (meta.getPCSuperclass() != null) meta = meta.getPCSuperclassMetaData(); return Id.newInstance(meta.getDescribedType(), val); }
/** * Return metadata for primary key fields declared in the given class. */ private static FieldMetaData[] getDeclaredPrimaryKeyFields (ClassMetaData meta) { if (meta.getPCSuperclass() == null) return meta.getPrimaryKeyFields(); // remove the primary key fields that are not declared // in the current class FieldMetaData[] fields = meta.getPrimaryKeyFields(); List decs = new ArrayList(fields.length); for (int i = 0; i < fields.length; i++) if (fields[i].getDeclaringType() == meta.getDescribedType()) decs.add(fields[i]); return (FieldMetaData[]) decs.toArray(new FieldMetaData[decs.size()]); }
/** * Return metadata for primary key fields declared in the given class. */ private static FieldMetaData[] getDeclaredPrimaryKeyFields (ClassMetaData meta) { if (meta.getPCSuperclass() == null) return meta.getPrimaryKeyFields(); // remove the primary key fields that are not declared // in the current class FieldMetaData[] fields = meta.getPrimaryKeyFields(); List decs = new ArrayList(fields.length); for (int i = 0; i < fields.length; i++) if (fields[i].getDeclaringType() == meta.getDescribedType()) decs.add(fields[i]); return (FieldMetaData[]) decs.toArray(new FieldMetaData[decs.size()]); }
/** * Return metadata for primary key fields declared in the given class. */ private static FieldMetaData[] getDeclaredPrimaryKeyFields (ClassMetaData meta) { if (meta.getPCSuperclass() == null) return meta.getPrimaryKeyFields(); // remove the primary key fields that are not declared // in the current class FieldMetaData[] fields = meta.getPrimaryKeyFields(); List decs = new ArrayList(fields.length); for (int i = 0; i < fields.length; i++) if (fields[i].getDeclaringType() == meta.getDescribedType()) decs.add(fields[i]); return (FieldMetaData[]) decs.toArray(new FieldMetaData[decs.size()]); }
/** * Return metadata for primary key fields declared in the given class. */ private static FieldMetaData[] getDeclaredPrimaryKeyFields (ClassMetaData meta) { if (meta.getPCSuperclass() == null) return meta.getPrimaryKeyFields(); // remove the primary key fields that are not declared // in the current class FieldMetaData[] fields = meta.getPrimaryKeyFields(); List decs = new ArrayList(fields.length); for (int i = 0; i < fields.length; i++) if (fields[i].getDeclaringType() == meta.getDescribedType()) decs.add(fields[i]); return (FieldMetaData[]) decs.toArray(new FieldMetaData[decs.size()]); }
private static Set<Class<?>> collectRelatedUnspecifiedTypes(ClassMetaData meta, Collection<? extends Class<?>> classes, Set<Class<?>> unspecified) { unspecified = collectUnspecifiedType(meta.getPCSuperclass(), classes, unspecified); for (FieldMetaData fmd : meta.getFields()) { if (fmd.isTransient()) continue; if (fmd.isTypePC()) unspecified = collectUnspecifiedType(fmd.getType(), classes, unspecified); if (fmd.getElement() != null && fmd.getElement().isTypePC()) unspecified = collectUnspecifiedType(fmd.getElement().getType(), classes, unspecified); if (fmd.getKey() != null && fmd.getKey().isTypePC()) unspecified = collectUnspecifiedType(fmd.getKey().getType(), classes, unspecified); if (fmd.getValue() != null && fmd.getValue().isTypePC()) unspecified = collectUnspecifiedType(fmd.getValue().getType(), classes, unspecified); } return unspecified; }
private static Set<Class<?>> collectRelatedUnspecifiedTypes(ClassMetaData meta, Collection<? extends Class<?>> classes, Set<Class<?>> unspecified) { unspecified = collectUnspecifiedType(meta.getPCSuperclass(), classes, unspecified); for (FieldMetaData fmd : meta.getFields()) { if (fmd.isTransient()) continue; if (fmd.isTypePC()) unspecified = collectUnspecifiedType(fmd.getType(), classes, unspecified); if (fmd.getElement() != null && fmd.getElement().isTypePC()) unspecified = collectUnspecifiedType(fmd.getElement().getType(), classes, unspecified); if (fmd.getKey() != null && fmd.getKey().isTypePC()) unspecified = collectUnspecifiedType(fmd.getKey().getType(), classes, unspecified); if (fmd.getValue() != null && fmd.getValue().isTypePC()) unspecified = collectUnspecifiedType(fmd.getValue().getType(), classes, unspecified); } return unspecified; }
private static Set<Class> collectRelatedUnspecifiedTypes(ClassMetaData meta, Collection<? extends Class> classes, Set<Class> unspecified) { unspecified = collectUnspecifiedType(meta.getPCSuperclass(), classes, unspecified); for (FieldMetaData fmd : meta.getFields()) { if (fmd.isTransient()) continue; if (fmd.isTypePC()) unspecified = collectUnspecifiedType(fmd.getType(), classes, unspecified); if (fmd.getElement() != null && fmd.getElement().isTypePC()) unspecified = collectUnspecifiedType(fmd.getElement().getType(), classes, unspecified); if (fmd.getKey() != null && fmd.getKey().isTypePC()) unspecified = collectUnspecifiedType(fmd.getKey().getType(), classes, unspecified); if (fmd.getValue() != null && fmd.getValue().isTypePC()) unspecified = collectUnspecifiedType(fmd.getValue().getType(), classes, unspecified); } return unspecified; }