我有3张桌子
function visibleHide(){
$('.hideme').each(function(){
var windowOneViewHeight = $(window).height() / 100;
var top_of_object = $(this).offset().top + ( (windowOneViewHeight * 10)); // no also add the item height, only the offset top is needed
var bottom_of_object = $(this).offset().top + ($(this).outerHeight() - (windowOneViewHeight * 10));
var top_of_window = $(window).scrollTop();
var bottom_of_window = $(window).scrollTop() + $(window).height();
if(bottom_of_object < top_of_window) {
$(this).css({'opacity':'0','top':'-80px'});
}
else if (top_of_object > bottom_of_window){
$(this).css({'opacity':'0','top':'80px'});
}
else if(bottom_of_object > top_of_window && top_of_object < bottom_of_window){
$(this).css({'opacity':'1','top':'0'});
}
});
}
此表有一对多连接到状态
的表2table 1
country
countryid countryname
表2有一对多加入城市表
table 2
state
stateid statename countryid
我尝试使用查询
阅读国家/地区table 3
city
cityid cityname stateid
它给了我国家对象,但状态列表是空的? 我做错了什么???
答案 0 :(得分:0)
好的我修好了。 在@oneToMany批注中使用cascade.all
并将hql更改为条件查询。
Criteria criteria = session.createCriteria(Country.class, "country");
criteria.add(Restrictions.eq("country.countryName", countryname));