代码:
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 可靠性设计
路径连接 Node JS 函数来连接总是返回正斜杠的路径(unix 和 windows 统一)。 path.join 的替代品 ###安装: npm install path.join ...//expected value for both UNIX and Windows: path/to/my/heart
- **Hibernate Configuration**: You'll set up the `hibernate.cfg.xml` file, which contains essential configuration settings for Hibernate, including database connection details and the location of ...
)为什么要选择这个因子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)的首达最优...
标题中的“hibernate和junit的jar”指的是两个重要的Java开发工具——Hibernate ORM框架的jar文件和JUnit测试框架的jar文件。这两个组件在Java应用开发中起着至关重要的作用。 **Hibernate ORM框架**是Java领域中最...
path2d-polyfill Polyfills Path2D API,用于在画布中呈现SVG路径 使用此功能可在Internet Explorer中启用Path2D功能。 用法 从CDN加载 [removed][removed] 或从npm安装 npm install --save path2d-polyfill 直接...
在图像的边缘像素中寻找符合车道线特征的直线,霍夫变换能很好地处理这种问题。 5. **线段合并**:检测到的可能是多段线,需要根据车道线的预期特性(如连续性、平行性)进行合并,得到完整的车道线。 6. **结果...
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...
### 关于选择问题的时间界限分析 #### 摘要与背景 本文主要研究了选择问题的时间界限,并提出了一种新的选择算法,该算法在平均情况下非常高效。文章给出了选择第i小元素所需的比较次数的上界和下界,并且这个下界...
SIEMENS SN 29500-2-2010.pdf
为了解决这个问题,我们提出了一个新的获取函数,即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....