Commit d9130144 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when fetching with null id return null

parent a22bbce1
......@@ -254,7 +254,10 @@ public abstract class BaseDao<T> {
* @return object width identifier given as parameter
*/
@SuppressWarnings("unchecked")
public T getById(int id) {
public T getById(Integer id) {
if (id == null) {
return null;
}
List<?> list = getSession()
.createQuery(" from " + this.clazz.getSimpleName() + " where id=:id " + removableAndStatemant())
.setParameter("id", id).list();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment