Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用将结果映射到 POJO 的 Hibernate 本机 SQL 查询。但是,我需要一个将列名绑定到属性名的映射 XML 文件。是否可以直接从没有 JPA 注释的代码中指定映射?
代码中的 OR/Mapping 意味着您必须在实体类中使用注释。没有注解,只能在代码中完成映射。但是您可以使用 Hibernate 注释而不是 JPA 注释。
例如,下面是 hibernate 支持的表映射的所有注解: