📄 videobean.java
字号:
package com.singnet.video.ejb;
import java.util.ArrayList;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.singnet.util.Pager;
import com.singnet.video.VideoInfo;
import com.singnet.video.dao.VideoDao;
public class VideoBean implements SessionBean {
SessionContext sessionContext;
VideoDao videoDao = new VideoDao();
boolean re = false;
public void ejbCreate() throws CreateException {
}
public void ejbRemove() {
}
public void ejbActivate() {
}
public void ejbPassivate() {
}
public void setSessionContext(SessionContext sessionContext) {
this.sessionContext = sessionContext;
}
public boolean addVideo(VideoInfo videoinfo) {
try {
re = videoDao.addVideo(videoinfo);
} catch (Exception e) {
e.printStackTrace();
}
return re;
}
public boolean editVideo(VideoInfo videoinfo) {
try {
re = videoDao.editVideo(videoinfo);
} catch (Exception e) {
e.printStackTrace();
}
return re;
}
public boolean deleteVideo(String id) {
try {
re = videoDao.deleteVideo(id);
} catch (Exception e) {
e.printStackTrace();
}
return re;
}
public ArrayList queryVideo(Pager pager) {
ArrayList list = new ArrayList();
try {
list = videoDao.queryVideoInfo(pager);
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
public int getTotal(Pager pager) {
int re = 0;
try {
re = videoDao.getTotal(pager);
} catch (Exception e) {
e.printStackTrace();
}
return re;
}
public VideoInfo getVideoById(String id) {
VideoInfo re = null;
try {
re = videoDao.getVideoByid(id);
} catch (Exception e) {
e.printStackTrace();
}
return re;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -