Search in sources :

Example 1 with MetaEmbeddable

use of io.crnk.jpa.meta.MetaEmbeddable in project crnk-framework by crnk-project.

the class EmbeddableMetaFactory method create.

@Override
public MetaEmbeddable create(Type type) {
    Class<?> rawClazz = ClassUtils.getRawType(type);
    Class<?> superClazz = rawClazz.getSuperclass();
    MetaElement superMeta = null;
    if (superClazz != Object.class) {
        superMeta = context.allocate(superClazz);
    }
    MetaEmbeddable meta = new MetaEmbeddable();
    meta.setElementType(meta);
    meta.setName(rawClazz.getSimpleName());
    meta.setImplementationType(type);
    meta.setSuperType((MetaDataObject) superMeta);
    if (superMeta != null) {
        ((MetaDataObject) superMeta).addSubType(meta);
    }
    createAttributes(meta);
    return meta;
}
Also used : MetaEmbeddable(io.crnk.jpa.meta.MetaEmbeddable) MetaElement(io.crnk.meta.model.MetaElement) MetaDataObject(io.crnk.meta.model.MetaDataObject)

Aggregations

MetaEmbeddable (io.crnk.jpa.meta.MetaEmbeddable)1 MetaDataObject (io.crnk.meta.model.MetaDataObject)1 MetaElement (io.crnk.meta.model.MetaElement)1