我正在尝试关联两个表
\n用户和地址\n一个用户有一个地址,一个地址只属于一个用户。键按地址 ID 列出\n所以我首先创建我的地址,然后创建一个用户并将其与地址 ID 链接\n但我根本无法做到这一点,我收到以下错误:
\nError creating bean with name \'entityManagerFactory\' defined in class path resource [org / springframework / boot / autoconfigure / orm / jpa / HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke "org.hibernate.mapping.PersistentClass.getTable ()" because "classMapping" is null\nRun Code Online (Sandbox Code Playgroud)\n我对休眠完全陌生,但我需要这个大学项目,所以请原谅我对这个主题的无知
\n那是我的代码:
\n用户/USUARIO 类别:
\nimport org.hibernate.validator.constraints.br.CPF;\n\nimport javax.persistence.*;\nimport javax.validation.constraints.*;\n\n\npublic class Usuario{\n\n @Id\n @GeneratedValue(strategy = GenerationType.IDENTITY)\n private Integer id;\n\n @Column\n @NotNull\n @Size(min = 5,max = 30)\n @Pattern(regexp = "^[a-zA-Z\\s]*$", …Run Code Online (Sandbox Code Playgroud)