public class PicsDaoJdbc extends java.lang.Object implements PicsDao
Pics.| Constructor and Description |
|---|
PicsDaoJdbc() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPic(Pic pic)
Add this
Pic to the database. |
int |
getMaxThumbCacheDirUsed()
Determine the highest numbered thumb cache subdirectory used.
|
Pic |
getNewestPic()
Get the newest pic in the database.
|
Pic |
getPic(int pid)
Get a single Pic
|
Pic |
getPic(java.lang.String name)
Get a single named Pic
|
int |
getPicCount() |
int |
getPicCount(int rid)
Return how many pics live in this root.
|
java.util.List<java.lang.String> |
getPicNames()
Get a List of names all of the pics in the database.
|
java.util.List<java.lang.String> |
getPicNamesByDateFunc(java.lang.String operator,
java.lang.String operand)
Get a list of pic names that pass this date function.
|
java.util.List<java.lang.String> |
getPicNamesByRootFunc(java.lang.String operator,
int rid) |
java.util.List<Pic> |
getPics()
Get a List of all the pics in the database
|
java.util.List<Pic> |
getPics(java.util.List<java.lang.String> list)
Get a List of Pics from this List of picNames.
|
java.util.List<Pic> |
getPics(java.lang.String name)
Get a list of Pics, wildcards supported
|
java.util.List<Pic> |
getPicsByMD5Sum(long md5sum)
Return a list of Pics that have this md5Sum
|
java.util.List<Pic> |
getPicsInDir(int rid,
java.lang.String dirName)
Get a list of Pics that are in this subdirectory
|
java.util.HashMap<java.lang.String,java.util.Date> |
getPicsMap()
Get a HashMap of all of the Pic names in the database.
|
java.util.List<Pic> |
getPicsNewerThan(java.util.Calendar calendar)
Get a list of Pics that are newer than this date
|
Pic |
getRandomPic()
Return a random pic from the database
|
Pic |
getRandomPic(int rid)
Return a random pic from the database that lives in this root
|
int |
getThumbCacheFillCount(int cacheDir)
Determine how many thumb cache entries are in this thumb dir
|
void |
setDataSource(javax.sql.DataSource ds)
Set the reference to the JDBC datasource.
|
void |
updatePic(Pic pic)
Update this
Pic in the database |
public void setDataSource(javax.sql.DataSource ds)
ds - The datasource as configured by Spring.public java.util.List<Pic> getPics()
public Pic getPic(java.lang.String name)
public Pic getPic(int pid)
public Pic getNewestPic()
PicsDaogetNewestPic in interface PicsDaopublic Pic getRandomPic()
PicsDaogetRandomPic in interface PicsDaopublic Pic getRandomPic(int rid)
PicsDaogetRandomPic in interface PicsDaopublic java.util.List<Pic> getPics(java.lang.String name)
public java.util.List<Pic> getPicsByMD5Sum(long md5sum)
PicsDaogetPicsByMD5Sum in interface PicsDaopublic java.util.List<Pic> getPics(java.util.List<java.lang.String> list)
PicsDaopublic java.util.List<Pic> getPicsInDir(int rid, java.lang.String dirName)
PicsDaogetPicsInDir in interface PicsDaorid - Root id to search underdirName - The directory, i.e. "2002/20021225"Rootspublic java.util.List<Pic> getPicsNewerThan(java.util.Calendar calendar)
PicsDaogetPicsNewerThan in interface PicsDaocalendar - The date to compare toPics.public java.util.HashMap<java.lang.String,java.util.Date> getPicsMap()
PicsDaogetPicsMap in interface PicsDaopublic java.util.List<java.lang.String> getPicNames()
PicsDaogetPicNames in interface PicsDaopublic java.util.List<java.lang.String> getPicNamesByDateFunc(java.lang.String operator,
java.lang.String operand)
PicsDaogetPicNamesByDateFunc in interface PicsDaooperator - An index into the MetaSet rateOps table. i.e. = != < >operand - the date to check. i.e. "2009-07-26"public java.util.List<java.lang.String> getPicNamesByRootFunc(java.lang.String operator,
int rid)
getPicNamesByRootFunc in interface PicsDaopublic void addPic(Pic pic)
PicsDaoPic to the database.public void updatePic(Pic pic) throws DataAccessException
Pic in the databasepublic int getMaxThumbCacheDirUsed()
PicsDaogetMaxThumbCacheDirUsed in interface PicsDaopublic int getPicCount()
public int getPicCount(int rid)
PicsDaogetPicCount in interface PicsDaorid - The root id to query.public int getThumbCacheFillCount(int cacheDir)
PicsDaogetThumbCacheFillCount in interface PicsDaocacheDir - Which thumb cache directory to check