link label to mindmaps

This commit is contained in:
Ezequiel Bergamaschi
2014-01-28 02:28:16 -03:00
committed by Ezequiel Bergamaschi
parent 72a46367d6
commit 2ec941e1a0
10 changed files with 94 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package com.wisemapping.dao;
import com.wisemapping.model.Label;
import com.wisemapping.model.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -14,6 +15,10 @@ public interface LabelManager {
@NotNull
List<Label> getAllLabels(@NotNull final User user);
@Nullable
Label getLabelById(int id);
@Nullable
Label getLabelByTitle(@NotNull final String title, @NotNull final User user);
}

View File

@@ -3,6 +3,7 @@ package com.wisemapping.dao;
import com.wisemapping.model.Label;
import com.wisemapping.model.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import java.util.List;
@@ -25,6 +26,13 @@ public class LabelManagerImpl extends HibernateDaoSupport
public List<Label> getAllLabels(@NotNull final User user) {
return getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where creator_id=?", user.getId());
}
@Nullable
@Override
public Label getLabelById(int id) {
return getHibernateTemplate().get(Label.class, id);
}
@Nullable
@Override
public Label getLabelByTitle(@NotNull String title, @NotNull final User user) {
@@ -35,4 +43,6 @@ public class LabelManagerImpl extends HibernateDaoSupport
}
return result;
}
}