1. OSGi Bundle: 2. OSGi Service: 2. JPA EntityManager: public interface JpaService { void save(Object entity); void delete(Object entity); Object findById(Class<?> entityClass, Object primaryKey); List<?> findAll(Class<?> entityClass); } @Entity @Service public class JpaServiceImpl implements JpaService { @PersistenceContext private EntityManager entityManager; } public class ExampleConsumer { @Reference JpaService jpaService; public void exampleMethod() { } }


上一篇:
下一篇:
切换中文