com.randomcoder.article
Interface ArticleDao

All Superinterfaces:
CreatableDao<Article,Long>, CrudDao<Article,Long>, DeletableDao<Article,Long>, ReadableDao<Article,Long>, UpdatableDao<Article,Long>

public interface ArticleDao
extends CrudDao<Article,Long>

Article data access interface.

 Copyright (c) 2006, Craig Condit. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
 
   * Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright notice,
     this list of conditions and the following disclaimer in the documentation
     and/or other materials provided with the distribution.
     
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 


Method Summary
 int countBeforeDate(Date endDate)
          Counts all Article objects created before the specified date.
 int countByTagBeforeDate(Tag tag, Date endDate)
          Counts all Article objects created before the specified date.
 Article findByPermalink(String permalink)
          Loads an Article by its permalink
 Iterator<Article> iterateByTag(Tag tag)
          Iterates Article objects with the given tag.
 List<Article> listAllInRange(int start, int limit)
          Lists Article objects within the range specified.
 List<Article> listBeforeDateInRange(Date endDate, int start, int limit)
          Lists Article objects created before the specified date and within the range specified.
 List<Article> listBetweenDates(Date startDate, Date endDate)
          Lists Article objects created within the specified date range.
 List<Article> listByTag(Tag tag)
          Lists Article objects with the given tag.
 List<Article> listByTagBeforeDateInRange(Tag tag, Date endDate, int start, int limit)
          Lists Article objects created before the specified date and within the range specified.
 List<Article> listByTagBetweenDates(Tag tag, Date startDate, Date endDate)
          Lists Article objects created within the specified date range.
 
Methods inherited from interface com.randomcoder.dao.CreatableDao
create
 
Methods inherited from interface com.randomcoder.dao.ReadableDao
read
 
Methods inherited from interface com.randomcoder.dao.UpdatableDao
update
 
Methods inherited from interface com.randomcoder.dao.DeletableDao
delete
 

Method Detail

findByPermalink

Article findByPermalink(String permalink)
Loads an Article by its permalink

Parameters:
permalink - permalink name
Returns:
article if found, or null if no match

listAllInRange

List<Article> listAllInRange(int start,
                             int limit)
Lists Article objects within the range specified.

Parameters:
start - starting result to return, from 0
limit - maximum number of results to return
Returns:
list of Article objects

listBeforeDateInRange

List<Article> listBeforeDateInRange(Date endDate,
                                    int start,
                                    int limit)
Lists Article objects created before the specified date and within the range specified.

Parameters:
endDate - upper bound of date range (exclusive)
start - starting result to return, from 0
limit - maximum number of results to return
Returns:
list of Article objects

listByTagBeforeDateInRange

List<Article> listByTagBeforeDateInRange(Tag tag,
                                         Date endDate,
                                         int start,
                                         int limit)
Lists Article objects created before the specified date and within the range specified.

Parameters:
tag - tag to restrict by
endDate - upper bound of date range (exclusive)
start - starting result to return, from 0
limit - maximum number of results to return
Returns:
list of Article objects

listByTag

List<Article> listByTag(Tag tag)
Lists Article objects with the given tag.

Parameters:
tag - tag
Returns:
list of Article objects

iterateByTag

Iterator<Article> iterateByTag(Tag tag)
Iterates Article objects with the given tag.

Parameters:
tag - tag
Returns:
Article iterator

listBetweenDates

List<Article> listBetweenDates(Date startDate,
                               Date endDate)
Lists Article objects created within the specified date range.

Parameters:
startDate - lower bound of date range (inclusive)
endDate - upper bound of date range (exclusive)
Returns:
list of Article objects

listByTagBetweenDates

List<Article> listByTagBetweenDates(Tag tag,
                                    Date startDate,
                                    Date endDate)
Lists Article objects created within the specified date range.

Parameters:
tag - tag to restrict by
startDate - lower bound of date range (inclusive)
endDate - upper bound of date range (exclusive)
Returns:
list of Article objects

countBeforeDate

int countBeforeDate(Date endDate)
Counts all Article objects created before the specified date.

Parameters:
endDate - upper bound of date range (exclusive)
Returns:
count of articles

countByTagBeforeDate

int countByTagBeforeDate(Tag tag,
                         Date endDate)
Counts all Article objects created before the specified date.

Parameters:
tag - tag to restrict by
endDate - upper bound of date range (exclusive)
Returns:
count of articles


Copyright © 2006-2010 Craig Condit. All Rights Reserved.