public static PersistenceType getPersistenceType(ClassMetaData meta) { if (meta == null) return BASIC; if (meta.isAbstract()) return MAPPED_SUPERCLASS; if (meta.isEmbeddable()) return EMBEDDABLE; return ENTITY; }
public static PersistenceType getPersistenceType(ClassMetaData meta) { if (meta == null) return BASIC; if (meta.isAbstract()) return MAPPED_SUPERCLASS; if (meta.isEmbeddable()) return EMBEDDABLE; return ENTITY; }
public static PersistenceType getPersistenceType(ClassMetaData meta) { if (meta == null) return BASIC; if (meta.isAbstract()) return MAPPED_SUPERCLASS; if (meta.isEmbeddable()) return EMBEDDABLE; return ENTITY; }
public static PersistenceType getPersistenceType(ClassMetaData meta) { if (meta == null) return BASIC; if (meta.isAbstract()) return MAPPED_SUPERCLASS; if (meta.isEmbeddable()) return EMBEDDABLE; return ENTITY; }
/** * Return true if this class has a concrete persistent superclass. */ private boolean hasConcretePCSuperclass() { if (_super == null) return false; if (!Modifier.isAbstract(_super.getModifiers()) && (!getPCSuperclassMetaData().isAbstract())) return true; return getPCSuperclassMetaData().hasConcretePCSuperclass(); }
/** * Return true if this class has a concrete persistent superclass. */ private boolean hasConcretePCSuperclass() { if (_super == null) return false; if (!Modifier.isAbstract(_super.getModifiers()) && (!getPCSuperclassMetaData().isAbstract())) return true; return getPCSuperclassMetaData().hasConcretePCSuperclass(); }
/** * Return true if this class has a concrete persistent superclass. */ private boolean hasConcretePCSuperclass() { if (_super == null) return false; if (!Modifier.isAbstract(_super.getModifiers()) && (!getPCSuperclassMetaData().isAbstract())) return true; return getPCSuperclassMetaData().hasConcretePCSuperclass(); }
/** * Return true if this class has a concrete persistent superclass. */ private boolean hasConcretePCSuperclass() { if (_super == null) return false; if (!Modifier.isAbstract(_super.getModifiers()) && (!getPCSuperclassMetaData().isAbstract())) return true; return getPCSuperclassMetaData().hasConcretePCSuperclass(); }
/** * Convenience method to determine if the pcType modeled by * this ClassMetaData object is both abstract and declares PKFields. This * method is used by the PCEnhancer to determine if special handling is * required. * * @return */ public boolean hasAbstractPKField() { if (_hasAbstractPKField != null) { return _hasAbstractPKField.booleanValue(); } // Default to false, set to true only if this type is abstract and // declares a PKField. Boolean temp = Boolean.FALSE; if (isAbstract() == true) { FieldMetaData[] declaredFields = getDeclaredFields(); if (declaredFields != null && declaredFields.length != 0) { for (FieldMetaData fmd : declaredFields) { if (fmd.isPrimaryKey()) { temp = Boolean.TRUE; break; } } } } _hasAbstractPKField = temp; return _hasAbstractPKField.booleanValue(); }
/** * Return the MetaDataTag for the given class meta data. */ private static MetaDataTag getEntityTag(ClassMetaData meta) { if (meta.isAbstract()) return MetaDataTag.MAPPED_SUPERCLASS; // @Embeddable classes can't declare Id fields if (meta.isEmbeddedOnly() && meta.getPrimaryKeyFields().length == 0) return MetaDataTag.EMBEDDABLE; if (meta.isMapped()) return MetaDataTag.ENTITY; return MetaDataTag.MAPPED_SUPERCLASS; }
/** * Return the MetaDataTag for the given class meta data. */ private static MetaDataTag getEntityTag(ClassMetaData meta) { if (meta.isAbstract()) return MetaDataTag.MAPPED_SUPERCLASS; // @Embeddable classes can't declare Id fields if (meta.isEmbeddedOnly() && meta.getPrimaryKeyFields().length == 0) return MetaDataTag.EMBEDDABLE; if (meta.isMapped()) return MetaDataTag.ENTITY; return MetaDataTag.MAPPED_SUPERCLASS; }
/** * Return the MetaDataTag for the given class meta data. */ private static MetaDataTag getEntityTag(ClassMetaData meta) { if (meta.isAbstract()) return MetaDataTag.MAPPED_SUPERCLASS; // @Embeddable classes can't declare Id fields if (meta.isEmbeddedOnly() && meta.getPrimaryKeyFields().length == 0) return MetaDataTag.EMBEDDABLE; if (meta.isMapped()) return MetaDataTag.ENTITY; return MetaDataTag.MAPPED_SUPERCLASS; }
/** * Return the MetaDataTag for the given class meta data. */ private static MetaDataTag getEntityTag(ClassMetaData meta) { if (meta.isAbstract()) return MetaDataTag.MAPPED_SUPERCLASS; // @Embeddable classes can't declare Id fields if (meta.isEmbeddedOnly() && meta.getPrimaryKeyFields().length == 0) return MetaDataTag.EMBEDDABLE; if (meta.isMapped()) return MetaDataTag.ENTITY; return MetaDataTag.MAPPED_SUPERCLASS; }
/** * Resolve the declared type. */ private void resolveDeclaredType(Class type) { ClassMetaData meta = _owner.getRepository().getMetaData(type, _owner.getDefiningMetaData().getEnvClassLoader(), false); if (meta != null) _decCode = JavaTypes.PC; if (meta != null && meta.isEmbeddedOnly() && !meta.isAbstract()) setEmbedded(true); if (!isEmbedded()) _decTypeMeta = meta; }
/** * Resolve the declared type. */ private void resolveDeclaredType(Class type) { ClassMetaData meta = _owner.getRepository().getMetaData(type, _owner.getDefiningMetaData().getEnvClassLoader(), false); if (meta != null) _decCode = JavaTypes.PC; if (meta != null && meta.isEmbeddedOnly() && !meta.isAbstract()) setEmbedded(true); if (!isEmbedded()) _decTypeMeta = meta; }
/** * Resolve the declared type. */ private void resolveDeclaredType(Class type) { ClassMetaData meta = _owner.getRepository().getMetaData(type, _owner.getDefiningMetaData().getEnvClassLoader(), false); if (meta != null) _decCode = JavaTypes.PC; if (meta != null && meta.isEmbeddedOnly() && !meta.isAbstract()) setEmbedded(true); if (!isEmbedded()) _decTypeMeta = meta; }
/** * Resolve the declared type. */ private void resolveDeclaredType(Class type) { ClassMetaData meta = _owner.getRepository().getMetaData(type, _owner.getDefiningMetaData().getEnvClassLoader(), false); if (meta != null) _decCode = JavaTypes.PC; if (meta != null && meta.isEmbeddedOnly() && !meta.isAbstract()) setEmbedded(true); if (!isEmbedded()) _decTypeMeta = meta; }
/** * The type of identity being used. This will be one of: * <ul> * <li>{@link #ID_UNKNOWN}: unknown identity type</li> * <li>{@link #ID_DATASTORE}: identity managed by the data store and * independent of the fields of the instance</li> * <li>{@link #ID_APPLICATION}: identity managed by the application and * defined by one or more fields of the instance</li> * </ul> If unspecified, defaults to {@link #ID_DATASTORE} if there are no * primary key fields, and {@link #ID_APPLICATION} otherwise. */ public int getIdentityType() { if (_identity != null) { return _identity; } else { ClassMetaData sup = getPCSuperclassMetaData(); if (sup != null && sup.getIdentityType() != ID_UNKNOWN) _identity = sup.getIdentityType(); else if (getPrimaryKeyFields().length > 0) _identity = ID_APPLICATION; else if (isMapped()) _identity = ID_DATASTORE; else if (isAbstract()) _identity = ID_UNKNOWN; else _identity = _repos.getMetaDataFactory().getDefaults(). getDefaultIdentityType(); } return _identity; }
/** * The type of identity being used. This will be one of: * <ul> * <li>{@link #ID_UNKNOWN}: unknown identity type</li> * <li>{@link #ID_DATASTORE}: identity managed by the data store and * independent of the fields of the instance</li> * <li>{@link #ID_APPLICATION}: identity managed by the application and * defined by one or more fields of the instance</li> * </ul> If unspecified, defaults to {@link #ID_DATASTORE} if there are no * primary key fields, and {@link #ID_APPLICATION} otherwise. */ public int getIdentityType() { if (_identity != null) { return _identity; } else { ClassMetaData sup = getPCSuperclassMetaData(); if (sup != null && sup.getIdentityType() != ID_UNKNOWN) _identity = sup.getIdentityType(); else if (getPrimaryKeyFields().length > 0) _identity = ID_APPLICATION; else if (isMapped()) _identity = ID_DATASTORE; else if (isAbstract()) _identity = ID_UNKNOWN; else _identity = _repos.getMetaDataFactory().getDefaults(). getDefaultIdentityType(); } return _identity; }
/** * The type of identity being used. This will be one of: * <ul> * <li>{@link #ID_UNKNOWN}: unknown identity type</li> * <li>{@link #ID_DATASTORE}: identity managed by the data store and * independent of the fields of the instance</li> * <li>{@link #ID_APPLICATION}: identity managed by the application and * defined by one or more fields of the instance</li> * </ul> If unspecified, defaults to {@link #ID_DATASTORE} if there are no * primary key fields, and {@link #ID_APPLICATION} otherwise. */ public int getIdentityType() { if (_identity != null) { return _identity; } else { ClassMetaData sup = getPCSuperclassMetaData(); if (sup != null && sup.getIdentityType() != ID_UNKNOWN) _identity = sup.getIdentityType(); else if (getPrimaryKeyFields().length > 0) _identity = ID_APPLICATION; else if (isMapped()) _identity = ID_DATASTORE; else if (isAbstract()) _identity = ID_UNKNOWN; else _identity = _repos.getMetaDataFactory().getDefaults(). getDefaultIdentityType(); } return _identity; }