0
我有这样的实体类通过JNDI访问/ ex实体类
package org.organization.domain;
@Entity
@Table(name = "GenPersonnel")
public class GenPersonnel implements java.io.Serializable {
//class members and setters, getteres are ommited. Nothing special
}
该类位于另一个作为maven依赖项插入到主项目中的jar。如果我只知道类名称作为字符串参数而没有完全限定名称,我怎么能通过JNDI获得这样的类对象?在这种情况下
String entityClazz = "GenPersonnel"
InitialContext ic = new InitialContext();
Object clasObject = ic.lookup(entityClazz);
任何帮助表示赞赏
谢谢队友。我需要这样直接的答案 – freeland