Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
package pt.estgp.estgweb.domain.dao.impl;
import pt.estgp.estgweb.domain.UrlStatDay;
import java.util.Date;
import java.util.List;
import static org.
hibernate.
criterion.
Restrictions.
*;
import org.hibernate.criterion.Order;
/**
* @author Jorge Machado
* @date 28/Fev/2008
* @time 2:51:06
* @see pt.estgp.estgweb.domain.dao.impl
*/
public class UrlStatDayDaoImpl
extends UrlStatDayDao
{
public static UrlStatDayDaoImpl getInstance
()
{
if (myInstance ==
null)
myInstance =
new UrlStatDayDaoImpl
();
return (UrlStatDayDaoImpl
) myInstance
;
}
/**
* load all dates between startDate and endDate
*
* @param startDate from date
* @param endDate to date
* @return list of UrlStatDay
*/
public List
<UrlStatDay
> loadDays
(1.5.0/docs/api/java/lang/String.html">String relativePath,
5+0%2Fdocs%2Fapi+Date">Date startDate,
5+0%2Fdocs%2Fapi+Date">Date endDate
)
{
return createCriteria
()
.
add(eq
("id.urlStatMonth.id.urlStatYear.id.urlStat.relativePath",relativePath
))
.
add(or
(gt
("date",startDate
),eq
("date",startDate
)))
.
add(or
(lt
("date",endDate
),eq
("date",endDate
))).
addOrder(Order.
asc("date")).
list();
}
}