- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能告诉我如何解决在 MySQL 数据库上使用 hibernate 和 jpa 的 spring mvc 应用程序中的以下错误?
[javax.el.PropertyNotFoundException: Property 'facilities' not found on type
org.springframework.samples.knowledgemanager.model.ProviderCompany] with root cause
javax.el.PropertyNotFoundException: Property 'facilities' not found on type
org.springframework.samples.knowledgemanager.model.ProviderCompany
创建底层表的sql是:
CREATE TABLE IF NOT EXISTS providerCompanies(
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(80),
INDEX(name)
);
CREATE TABLE IF NOT EXISTS facilityAddresses(
id int(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
company_id int(11) UNSIGNED NOT NULL,
type_id int(11) UNSIGNED NOT NULL,
facilityname varchar(50),
address varchar(200),
city varchar(200),
state_id int(11) UNSIGNED NOT NULL,
zip varchar(50),
isHQ bool,
FOREIGN KEY (company_id) REFERENCES providerCompanies(id),
FOREIGN KEY (type_id) REFERENCES locationTypes(id),
FOREIGN KEY (state_id) REFERENCES states(id)
);
ProviderCompany
类是:
@Entity
@Table(name = "providerCompanies")
public class ProviderCompany extends NamedEntity {
@ManyToMany(cascade = {CascadeType.ALL})
@JoinTable(name="companyContactJunction",
joinColumns={@JoinColumn(name="company_id")},
inverseJoinColumns={@JoinColumn(name="contact_id")})
protected Set<OfficeContact> companycontacts = new HashSet<OfficeContact>();
@OneToMany(cascade = CascadeType.ALL, mappedBy = "company", fetch=FetchType.EAGER)
protected Set<FacilityAddress> facilities = new HashSet<FacilityAddress>();
////////////OfficeContact methods
protected void setContactsInternal(Set<OfficeContact> locs) {this.companycontacts = locs;}
protected Set<OfficeContact> getContactsInternal() {
if (this.companycontacts == null) {this.companycontacts = new HashSet<OfficeContact>();}
return this.companycontacts;
}
public List<OfficeContact> getContacts() {
List<OfficeContact> sortedLocs = new ArrayList<OfficeContact>(getContactsInternal());
PropertyComparator.sort(sortedLocs, new MutableSortDefinition("contact", true, true));
return Collections.unmodifiableList(sortedLocs);
}
public void addContact(OfficeContact oc) {
getContactsInternal().add(oc);
oc.addCompany(this);
}
public OfficeContact getContact(String fa) {return getContact(fa, false);}
public OfficeContact getContact(String fa, boolean ignoreNew) {
fa = fa.toLowerCase();
for (OfficeContact e : getContactsInternal()) {
if (!ignoreNew || !e.isNew()) {
String compName = e.getLastName();
compName = compName.toLowerCase();
if (compName.equals(fa)) {return e;}
}
}
return null;
}
////////////Location methods
protected void setFacilitiesInternal(Set<FacilityAddress> addresses) {this.facilities = addresses;}
protected Set<FacilityAddress> getFacilitiesInternal() {
if (this.facilities == null) {this.facilities = new HashSet<FacilityAddress>();}
return this.facilities;
}
public List<FacilityAddress> getFacilities() {
List<FacilityAddress> sortedLocations = new ArrayList<FacilityAddress>(getFacilitiesInternal());
PropertyComparator.sort(sortedLocations, new MutableSortDefinition("location", true, true));
return Collections.unmodifiableList(sortedLocations);
}
public void addFacility(FacilityAddress addr) {
getFacilitiesInternal().add(addr);
addr.setCompany(this);
}
public FacilityAddress getFacility(String address) {return getFacility(address, false);}
public FacilityAddress getFacility(String addr, boolean ignoreNew) {
addr = addr.toLowerCase();
for (FacilityAddress address1 : getFacilitiesInternal()) {
if (!ignoreNew || !address1.isNew()) {
String compName = address1.getAddress();
compName = compName.toLowerCase();
if (compName.equals(addr)) {return address1;}
}
}
return null;
}
}
FacilityAddress
类是:
@Entity
@Table(name = "facilityAddresses")
public class FacilityAddress extends BaseEntity{
@Column(name="address")
protected String address;
@Column(name="city")
protected String city;
@ManyToOne
@JoinColumn(name = "state_id")
protected State state;
@Column(name="zip")
protected String zip;
@ManyToOne
@JoinColumn(name = "company_id")
protected ProviderCompany company;
@ManyToOne
@JoinColumn(name = "type_id")
protected LocationType locationType;
@Column(name = "facilityname")
protected String facilityname;
@Column(name = "isHQ")
protected boolean isHQ;
@ManyToMany(mappedBy="facilities")
protected Set<Provider> providers = new HashSet<Provider>();
public String getAddress(){return address;}
public void setAddress(String addr){address=addr;}
public String getCity(){return city;}
public void setCity(String cty){city=cty;}
public State getState(){return this.state;}
public void setState(State st){state=st;}
public String getZip(){return zip;}
public void setZip(String zp){zip=zp;}
protected void setCompany(ProviderCompany pc) {this.company = pc;}
public ProviderCompany getCompany(){return this.company;}
public LocationType getLocationType(){return locationType;}
public void setLocationType(LocationType lt){locationType=lt;}
public String getFacilityname(){return facilityname;}
public void setFacilityname(String dir){facilityname=dir;}
public boolean getIsHQ(){return isHQ;}
public void setIsHQ(boolean ma){isHQ=ma;}
public void addProvider(Provider p) {providers.add(p);}
public Set<Provider> getProviders(){return this.providers;}
public boolean isNew() {return (this.id == null);}
}
这是 BaseEntity.java
:
@MappedSuperclass
public class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected Integer id;
public void setId(Integer id) {this.id = id;}
public Integer getId() {return id;}
public boolean isNew() {return (this.id == null);}
}
这是 NamedEntity.java
:
@MappedSuperclass
public class NamedEntity extends BaseEntity {
@Column(name = "name")
private String name;
public void setName(String name) {this.name = name;}
public String getName() {return this.name;}
@Override
public String toString() {return this.getName();}
}
JpaProviderCompanyRepository 是:
@Repository
public class JpaProviderCompanyRepositoryImpl implements ProviderCompanyRepository {
@PersistenceContext
private EntityManager em;
@SuppressWarnings("unchecked")
public Collection<ProviderCompany> findByName(String name) {
System.out.println("---------------------- inside findByName() ");
Query query = this.em.createQuery("SELECT DISTINCT company FROM ProviderCompany company left join fetch company.facilities WHERE company.name LIKE :name");
System.out.println("---------------------- just created query. ");
query.setParameter("name", name + "%");
System.out.println("---------------------- just set parameter for query. ");
Collection<ProviderCompany> results = query.getResultList();
System.out.println("---------------------- just stored query results in collection. ");
return results;//query.getResultList();
}
@Override
public ProviderCompany findById(int id) {
// using 'join fetch' because a single query should load both owners and pets
// using 'left join fetch' because it might happen that an owner does not have pets yet
System.out.println("<<<<<<<<<<<<<<<<<<<<<<<< inside Jpa Repository findById() >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
Query query = this.em.createQuery("SELECT company FROM ProviderCompany company left join fetch company.facilities WHERE company.id =:id");
System.out.println("========================= Just set query. ");
query.setParameter("id", id);
System.out.println("------------------------- Just added parameter to query. ");
ProviderCompany pc = (ProviderCompany) query.getSingleResult();
System.out.println("------------------------- Just created ProviderCompany object from query result. ");
return pc;
}
@Override
public void save(ProviderCompany company) {
if (company.getId() == null) {this.em.persist(company);}
else {this.em.merge(company);}
}
}
完整的堆栈跟踪是:
Jan 24, 2014 11:10:12 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.el.PropertyNotFoundException: Property 'facilities' not found on type org.springframework.samples.knowledgemanager.model.ProviderCompany
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:237)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:214)
at javax.el.BeanELResolver.property(BeanELResolver.java:325)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:183)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:1026)
at org.apache.jsp.WEB_002dINF.jsp.companies.companiesList_jsp._jspService(companiesList_jsp.java:327)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:263)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.github.dandelion.datatables.core.web.filter.DatatablesFilter.doFilter(DatatablesFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.github.dandelion.datatables.extras.servlet2.filter.DatatablesFilter.doFilter(DatatablesFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Jan 24, 2014 11:10:12 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [KnowledgeManager] in context with path [/knowledgemanager] threw exception [javax.el.PropertyNotFoundException: Property 'facilities' not found on type org.springframework.samples.knowledgemanager.model.ProviderCompany] with root cause
javax.el.PropertyNotFoundException: Property 'facilities' not found on type org.springframework.samples.knowledgemanager.model.ProviderCompany
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:237)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:214)
at javax.el.BeanELResolver.property(BeanELResolver.java:325)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:183)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:1026)
at org.apache.jsp.WEB_002dINF.jsp.companies.companiesList_jsp._jspService(companiesList_jsp.java:327)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:263)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.github.dandelion.datatables.core.web.filter.DatatablesFilter.doFilter(DatatablesFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.github.dandelion.datatables.extras.servlet2.filter.DatatablesFilter.doFilter(DatatablesFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
最佳答案
我没有在 ProviderCompany 中看到 facilities
属性的任何 setter 。尝试添加一个 setFacilities()
方法。
关于java - spring hibernate jpa中的多对一关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21339088/
我有以下情况要解决,但无法正常工作(尝试了Hibernate和EclipseLink): Table_1: Column_A is Primary Key ... some other
我是 JPA 的新手,但必须在该技术中实现我的项目 我想做的是通过 CriteriaQuery 构建一些数据库查询,但不知道如何将参数列表传递给下面的代码: CriteriaBuilder qb =
我是 JPA 新手,注意到可以通过使用 @Version 注释实体中的字段来使用乐观锁定。我只是好奇,如果之前不存在,持久性提供程序是否会创建一个隐式版本字段。例如网站objectdb状态: "Whe
我有一个 JPA 查询 @Query(value = "SELECT SUM(total_price) FROM ... WHERE ...", nativeQuery = true) 当有匹配的记录
JPA 是否会尝试在已经持久(和非分离)的实体上级联持久化? 为了清楚起见,这是我的情况:我想保留一个新用户: public void addUser(){ //User is an enti
显然,OpenJPA。我也看到提到过 EclipseLink 和 Hibernate,但是在功能上有显着差异吗? 最佳答案 大多数差异来自提供者对 OSGi 的感知程度。例如,您可能需要自己将 Hib
我想将 JPA 用于 micronaut。为此,我使用 io.micronaut.data:micronaut-data-hibernate-jpa:1.0.0.M1 库。每当我运行应用程序并点击端点
我正准备为我的应用实现后端,现在我正在投影数据层。我期待着 Spring 。 最佳答案 Spring Data JPA 不是 JPA 实现。它提供了将数据访问层构建到底层 JPA 顶部的方法。您是否应
假设我有一个表 Item,其中包含一个名为 user_id 的列和一个表 User 以及另一个名为 Superuser 的列: CREATE TABLE Item(id int, user_id in
JPA 2.1 规范说: The entity class must not be final. No methods or persistent instance variables of the
我正在从事一个具有一些不寻常实体关系的项目,我在使用 JPA 时遇到了问题。有两个相关对象;用户,让我们称另一个 X。用户与 X 具有一对多和两个一对一的关系。它基本上看起来像这样 [用户实体] @O
我说的是 JavaEE 中的 JPA。在我读过的一本书中谈到: EntityManager em; em.find(Employee.class, id); “这是实体管理器在数据库中查找实例所需的所
我有 JPA 支持的 Vaadin 应用程序。此应用程序中的组件绑定(bind)到 bean 属性(通过独立的 EL 实现)。一些组件绑定(bind)到外部对象(或其字段),由@OneToOne、@O
是否可以使表中的外键唯一?假设我有实体 A 和 B。 答: @Entity class A extends Serializable { @Id private long id; @OneToOne
我在使用 JPA 时遇到了一点问题。考虑这种情况: 表 A (id_a) | 表 B (id_b, id_a) 我需要的是这样的查询: Select a.*, c.quantity from A as
我有一个由 JPA 管理的实体类,我有一个实体需要在其属性中记录更改。 JPA 是否提供任何方法来处理这种需求? 最佳答案 如果您使用 Hibernate 作为 JPA 提供程序,请查看 Hibern
我想实现以下架构: Table A: a_id (other columns) Table B: b_id (other columns) Table C: c_id (other columns)
我有一个愚蠢的问题。如果能做到的话那就太好了,但我并没有屏住呼吸。 我需要链接到我的 JPA 实体的表中的单个列作为所述 JPA 实体中的集合。有什么方法可以让我单独取回与该实体相关的列,而不必取回整
我有一个 Open JPA 实体,它成功连接了多对多关系。现在我成功地获取了整个表,但我实际上只想要该表中的 ID。我计划稍后调用数据库来重建我需要的实体(根据我的程序流程)。我只需要 ID(或该表中
这是我的一个实体的复合主键。 public class GroupMembershipPK implements Serializable{ private static final long
我是一名优秀的程序员,十分优秀!