Kawai Wiki

Compare Revisions

Ignore whitespace Rev 62 → Rev 63

/trunk/src/main/java/org/kawai/dao/PageDAO.java
35,4 → 35,6
public Preview loadPreview(int userId, String name, Language lang);
public Preview insertPreview(int userId, Page p);
public void deletePreview(int userId, String name, Language lang);
}
/trunk/src/main/java/org/kawai/dao/jdbc/JdbcPageDAO.java
208,7 → 208,16
p.setLanguageId(lang.getId());
p.setUserId(userId);
return session.loadUnique(p);
p = session.loadUnique(p);
if (p != null) {
User user = new User();
user.setId(userId);
session.load(user);
p.setUser(user);
}
return p;
}
@Override
258,4 → 267,14
return p;
}
}
@Override
public void deletePreview(int userId, String name, Language lang) {
Preview preview = loadPreview(userId, name, lang);
if (preview != null) {
Preview p = new Preview();
p.setId(preview.getId());
session.delete(p);
}
}
}