代码:
Os类
public class Os {
private Long id;
.
.
...
private Set<OsFeature> osFeatures = new HashSet<OsFeature>();
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="OsId", unique = true, nullable = false, insertable = true,
updatable = true)
public Long getOsId() {
return osId;
}
.
.
.
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "os")
public Set<OsFeature> getOsFeatures() {
return osFeatures;
}
}
OsFeature类:
public class OsFeature{
private Long id;
private Os os;
.
.
.
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "OsFeatureId", unique = true, nullable = false, insertable = true, updatable = true)
public Long getId() {
return id;
}
.
.
.
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "OsId", referencedColumnName = "OsId", unique = false, nullable = false, insertable = true, updatable = true)
public Os getOs() {
return os;
}
}
分析:
Os与 OsFeature之间的关联为:OneToMany(一对多);
需求:
查询Os,需要OsFeature中的某个属性作为查询条件;
HQL语句:
select model from Os model join model.osFeatures osf where osf.featureString
like %xxxx%
语句分析:join后面所跟的是 model.osFeatures,osFeatures为Os中的属性,而并不是OsFeature对象
如果join后面跟的是OsFeature对象,将会报Path expected for join异常!
分享到:
相关推荐
SN_29500-9_Part_4_Expected_values_for_switches_and_buttons
SN_29500-9_Part_9_Expected_values_for_switches_and_buttons
Ultra-Dense Networks for 5G and Beyond:Modelling, Analysis, and Applications Ultra-Dense Networks for 5G and Beyond:Modelling, Analysis, and App.pdf (8.28 MB, 下载次数: 137 ) We are ...
SN_29500-5_Part_5_Expected_values_for_electrical_connections,_electrical_connectors_and_sockets 可靠性设计
)为什么要选择这个因子Fama and Bliss find little evidence that forward rates can forecast n
Look ahead — learn about Windows Presentation Foundation, widely expected to be the Windows development tool of tomorrow A range of services — gain information on various web services such as ASP...
一类基因表达式程序设计的首达最优解期望时间,杜欣,丁立新,本文研究了一类基于精英保留策略的基因表达式程序设计方法(Gene Expression Programming with maintaining elitist strategy,简称ME-GEP)的首达最优...
路径连接 Node JS 函数来连接总是返回正斜杠的路径(unix 和 windows 统一)。 path.join 的替代品 ###安装: npm install path.join ...//expected value for both UNIX and Windows: path/to/my/heart
expected time bounds for selection
SIEMENS SN 29500-2-2010.pdf
这个一个python实现的车道线识别程序,基于opencv库。压缩包内还附了测试用的图像和视频,适合进行python和图像处理学习。
多目标优化,模型优化,超体积期望提升算法
No prior experience with Hyper-V is expected. Table of Contents Chapter 1: Hyper-V Basics Chapter 2: Building a Failover Cluster Chapter 3: An Introduction to System Center Virtual Machine Manager ...
Semiparametric GARCH models with long memory applied to value-at-risk and expected shortfall.xdf
expected. 1 This book is a product of how much we love writing software, and our hope is that it will help you do the same in ways you never thought possible. A LVARO V IDELA D ÜBENDORF , S ...
SIEMENS SN 29500-5-2004 Expected values for electrical connections, connectors and sockets SIEMENS SN 29500-4-2004 Expected values for passive components SIEMENS SN 29500-3-2009 Expected...
为了解决这个问题,我们提出了一个新的获取函数,即EUR,它用作从一组最佳样本中选择最佳样本的元标准,每个样本均根据获取准则从大量候选样本中识别出来功能。 方法 欧元不像大多数现有的收购职能那样依赖于基于...
On Cybersecurity for Architects will help you to successfully design, integrate, and implement complex security structures in any solution whilst ensuring that the solution functions as expected....
This study shows that the principle of a recently proposed common-path laser interferometer containing a planar grating is nonexistent and apparently caused by a mathematical derivation error....
IE下使用uploadify上传报:Uploadify-Script5007 Object expected解决方案