天天看點

hibernate自定義sql,多表查詢,傳回自定義vo類(二)

https://blog.csdn.net/lw5885799/article/details/81103183

import org.springframework.stereotype.Repository;

import javax.persistence.EntityManager;

import javax.persistence.PersistenceContext;

import javax.transaction.Transactional;

@Repository

public class EntityManagerDAO {

    @PersistenceContext

    private EntityManager entityManager;

    @Transactional

    public List<BackstageUserListDTO自定義VO> listUser(){

        String sql = "select a.create_time createTime," +

                "a.mobilephone phoneNum," +

                "a.email email,a.uid uid," +

                "a.enabled enabled," +

繼續閱讀