Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Iteration group - work in progress: implemented list of groups table
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Apr 12, 2012
1 parent 0307a4a commit f2ad51b
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 1 deletion.
@@ -0,0 +1,56 @@
/*
* Copyright 2012, Red Hat, Inc. and individual contributors as indicated by the
* @author tags. See the copyright.txt file in the distribution for a full
* listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
* site: http://www.fsf.org.
*/
package org.zanata.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.zanata.model.HIterationGroup;

/**
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a>
*/
@Name("versionGroupDAO")
@AutoCreate
@Scope(ScopeType.STATELESS)
public class VersionGroupDAO extends AbstractDAOImpl<HIterationGroup, Long>
{
public VersionGroupDAO()
{
super(HIterationGroup.class);
}

public VersionGroupDAO(Session session)
{
super(HIterationGroup.class, session);
}

public List<HIterationGroup> getAllVersionGroups()
{
Query query = getSession().createQuery("from HIterationGroup");
return query.list();
}
}
Expand Up @@ -24,8 +24,10 @@

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.zanata.dao.VersionGroupDAO;
import org.zanata.model.HIterationGroup;
import org.zanata.service.VersionGroupService;

Expand All @@ -37,9 +39,12 @@
@Scope(ScopeType.STATELESS)
public class VersionGroupServiceImpl implements VersionGroupService
{
@In
private VersionGroupDAO versionGroupDAO;

@Override
public List<HIterationGroup> getAllVersionGroups()
{
return null; //To change body of implemented methods use File | Settings | File Templates.
return versionGroupDAO.getAllVersionGroups();
}
}
Expand Up @@ -30,6 +30,7 @@
<class>org.zanata.model.HGlossaryEntry</class>
<class>org.zanata.model.HGlossaryTerm</class>
<class>org.zanata.model.HTermComment</class>
<class>org.zanata.model.HIterationGroup</class>
<class>org.zanata.model.po.HPoHeader</class>
<class>org.zanata.model.po.HPoTargetHeader</class>
<class>org.zanata.model.po.HPotEntryData</class>
Expand Down
Expand Up @@ -40,6 +40,7 @@
<class>org.zanata.model.HGlossaryEntry</class>
<class>org.zanata.model.HGlossaryTerm</class>
<class>org.zanata.model.HTermComment</class>
<class>org.zanata.model.HIterationGroup</class>
<class>org.zanata.model.po.HPoHeader</class>
<class>org.zanata.model.po.HPoTargetHeader</class>
<class>org.zanata.model.po.HPotEntryData</class>
Expand Down
Expand Up @@ -38,6 +38,7 @@
<class>org.zanata.model.HGlossaryEntry</class>
<class>org.zanata.model.HGlossaryTerm</class>
<class>org.zanata.model.HTermComment</class>
<class>org.zanata.model.HIterationGroup</class>
<class>org.zanata.model.po.HPoHeader</class>
<class>org.zanata.model.po.HPoTargetHeader</class>
<class>org.zanata.model.po.HPotEntryData</class>
Expand Down

0 comments on commit f2ad51b

Please sign in to comment.