panoramaserviceimp.java
来自「利用hibernate框架进行开发的全景浏览与导航系统。」· Java 代码 · 共 59 行
JAVA
59 行
package com.shandong.business.imp;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.criterion.Example;
import com.shandong.bean.VPanoramaHotspot;
import com.shandong.bean.base._BaseRootDAO;
import com.shandong.business.iface.PanoramaService;
public class PanoramaServiceImp implements PanoramaService {
public List findHotspotByPanorama(String id) {
// TODO Auto-generated method stub
try {
_BaseRootDAO.initialize();
_BaseRootDAO dao = new com.shandong.bean.dao.THotspotDAO();
VPanoramaHotspot panorama = new VPanoramaHotspot();
panorama.setPanorama(id);
Example example = Example.create(panorama);
Criteria cirteria = dao.getSession().createCriteria(
VPanoramaHotspot.class);
cirteria.add(example);
return cirteria.list();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public String getFloor(String id) {
String s = id.substring(0, 3);
if (s.equals("104") || s.equals("105") || s.equals("106")
|| s.equals("107")) {
return "2";
}
if (s.equals("108") || s.equals("109") || s.equals("110")) {
return "3";
}
if (s.equals("111") || s.equals("112")) {
return "4";
}
return "1";
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?