Search in sources :

Example 1 with EntityServiceBuilder

use of org.jowidgets.cap.service.tools.entity.EntityServiceBuilder in project jo-client-platform by jo-source.

the class JpaEntityService method afterPropertiesSet.

@Override
@SuppressWarnings("unchecked")
public void afterPropertiesSet() {
    final EntityServiceBuilder entityServiceBuilder = new EntityServiceBuilder();
    for (final EntityType<?> type : entityManagerFactory.getMetamodel().getEntities()) {
        final Class<?> clazz = type.getBindableJavaType();
        if (IBean.class.isAssignableFrom(clazz)) {
            final Class<? extends IBean> beanType = (Class<? extends IBean>) clazz;
            final Class<? extends IBean> beanInterface = new BeanTypeUtil(beanType).getBeanInterface();
            addServicesProviderAndDescriptor(entityServiceBuilder, beanInterface, beanType);
        }
    }
    entityService = entityServiceBuilder.build();
}
Also used : BeanTypeUtil(org.jowidgets.cap.service.spring.BeanTypeUtil) EntityServiceBuilder(org.jowidgets.cap.service.tools.entity.EntityServiceBuilder) IBean(org.jowidgets.cap.common.api.bean.IBean)

Aggregations

IBean (org.jowidgets.cap.common.api.bean.IBean)1 BeanTypeUtil (org.jowidgets.cap.service.spring.BeanTypeUtil)1 EntityServiceBuilder (org.jowidgets.cap.service.tools.entity.EntityServiceBuilder)1