我碰巧找到了使用这个结构的例子,虽然我不知道我能从中得到什么?
这是否意味着无状态EJB中的所有select语句都应遵循此规则?
@Stateless
public class EmployeeFacade {
@PersistenceContext(unitName="EmployeeService")
EntityManager em;
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List<Department> findAllEmployees() {
return em.createQuery("SELECT e FROM Employee e",
Employee.class)
.getResultList();
}
Run Code Online (Sandbox Code Playgroud)
我从中得到了什么?
谢谢.
你得到的是: