我正在使用 Liferay 7 GA 4。左侧是 Liefray 菜单(控制面板、用户等...)
我想为普通用户删除此菜单,并使其仅对管理员可见。
任何人都可以帮助我找到如何做到这一点?
非常感谢提前
我正在尝试使用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)