我对wsgen没什么问题,每当我使用它时,我都会收到错误"class not found".我想在目录webservices中将它用于类StudentServiceEndpoint.任何想法我该怎么做?
这是我的直线结构图:http://img198.imageshack.us/img198/4274/5g8.png
http://img441.imageshack.us/img441/737/eo4.png
PS.抱歉我的英文; p
编辑:我编辑了图像.
我正在尝试更改hibernate.cfg.xml中的属性,但是我的代码不起作用。
public static void changeConfiguration(String login, String password){
Configuration cfg = new Configuration();
cfg.configure();
cfg.setProperty("hibernate.connection.password", password);
cfg.setProperty("hibernate.connection.username", login);
}
Run Code Online (Sandbox Code Playgroud)
任何想法,为什么那不起作用?我的文件hibernate.cfg.xml总是看起来一样。
我有一点问题:(当我尝试这样做时:
List<Dokumenty> dokumentyList =
(List<Dokumenty>)dokumentyDAO.getDokumentyByTrasy(((Trasy)routeComboBox.getSelectedItem()).getId());
for (Dokumenty dokumenty : dokumentyList){}
Run Code Online (Sandbox Code Playgroud)
然后我在for循环中得到错误:
java.lang.ClassCastException:[Ljava.lang.Object; 无法强制转换为database.entity.Dokumenty
我的DokumentyDAO看起来像这样:
public class DokumentyDAO{
private static volatile DokumentyDAO instance = null;
private DokumentyDAO() {}
public static DokumentyDAO getInstance() {
if (instance == null) {
synchronized (DokumentyDAO.class) {
if (instance == null) {
instance = new DokumentyDAO();
}
}
}
return instance;
}
public List<Dokumenty> getDokumentyByTrasy(long idTrasy){
Session session = HibernateUtil.getSessionFactory().openSession();
Query query = session.createQuery(
"FROM Dokumenty dokumenty "
+ "left join dokumenty.dostawy dostawy "
+ "left join …Run Code Online (Sandbox Code Playgroud)