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.
有没有办法以编程方式从表名中确定 EJB 实体类和 id 列?
我有表名,我想要的是一种从表名中获取实体类名和 id 列名的方法。
这可能吗?
每个实体类都有描述表名以及哪个字段是标识列的注释。
谢谢
您可以使用反射并遍历所有 ejb 以找到该名称的正确匹配项。
您必须知道一个表可以映射到多个一个实体,反之亦然。