小编Jud*_*989的帖子

Liferay- 删除控制面板菜单

我正在使用 Liferay 7 GA 4。左侧是 Liefray 菜单(控制面板、用户等...)

我想为普通用户删除此菜单,并使其仅对管理员可见。

任何人都可以帮助我找到如何做到这一点?

非常感谢提前

liferay-7

4
推荐指数
1
解决办法
2346
查看次数

无法打开由此ResultSet导致的连接已关闭

我正在尝试使用Maven Spring MVC JPA和Postgres制作一个Web应用程序.但我仍然无法在数据库中持久保存对象.我在启动交易时遇到错误:

org.hibernate.exception.GenericJDBCException: Could not open connection
caused by org.postgresql.util.PSQLException: This ResultSet is closed.
Run Code Online (Sandbox Code Playgroud)

这是代码

@Controller
public class ExamController {

@GetMapping("/hello")
public String hello(Model model) {

    // EntityManager entityManager = 
EntityManagerUtil.getEntityManager();

    try {
        EntityManager entityManager = 
            Persistence.createEntityManagerFactory("examinatorpu").createEntityManager();

        entityManager.getTransaction().begin();
        entityManager.persist(new Exam());
        entityManager.getTransaction().commit();
        entityManager.close();
        System.out.println("_exam_ok_");

    } catch (Exception e) {
        // entityManager.getTransaction().rollback();
        e.printStackTrace();
        System.out.println("_exam_ko_");
    }

    model.addAttribute("examId", "1");

    return "welcome";
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的实体

@Entity
@Table(name = "EXAM")
public class Exam {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "EXAM_ID")
    private long id; …
Run Code Online (Sandbox Code Playgroud)

java postgresql spring hibernate jpa

2
推荐指数
1
解决办法
4443
查看次数

标签 统计

hibernate ×1

java ×1

jpa ×1

liferay-7 ×1

postgresql ×1

spring ×1