Skip to content
Snippets Groups Projects
Commit d9130144 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when fetching with null id return null

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