Java/JPA with Error25 [해결 방법] org.hibernate.hql.internal.ast.QuerySyntaxException 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 public class Main { public static void main(String[] args) { // 생략 try { Team team = new Team(); team.setName("Team"); em.persist(team); Member member = new Member(); member.setName("Member"); member.setAge(10); memb.. 2023. 9. 24. [해결 방법] java.lang.IllegalArgumentException 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 public class Main { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello"); EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begi.. 2023. 9. 22. [해결 방법] javax.persistence.NonUniqueResultException 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class Main { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello"); EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin().. 2023. 9. 22. [해결 방법] javax.persistence.NoResultException 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ ⌨️ 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 public class Main { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello"); EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin().. 2023. 9. 22. [해결 방법] org.h2.jdbc.JdbcSQLSyntaxErrorException 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ ⌨️ 코드 Order Entity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 @Entity public class Order { @Id @GeneratedValue private Long id; private int orderAmount; @Embedded private Address address; @ManyToOne @JoinColumn(name = "PRODUCT_ID") private Product product; } 🖨️오류 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3.. 2023. 9. 22. [해결 방법] org.hibernate.QueryException 👉 기본 환경 - Language: Java - DB: H2 Database - IDE: IntelliJ ⌨️ 코드 Member Entity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 @Entity public class Member extends BaseEntity { @Id @GeneratedValue @Column(name = "MEMBER_ID") private Long id; @Column(name = "USERNAME") private String name; @ManyToOne(fetch = FetchType.EAGER) // Member : Team = Many : One @JoinColumn(name = "TEAM_ID") // JoinColum = FK p.. 2023. 9. 20. 이전 1 2 3 4 5 다음