public class PicsDaoJdbc extends java.lang.Object implements PicsDao
Pic
s.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()
PicsDao
getNewestPic
in interface PicsDao
public Pic getRandomPic()
PicsDao
getRandomPic
in interface PicsDao
public Pic getRandomPic(int rid)
PicsDao
getRandomPic
in interface PicsDao
public java.util.List<Pic> getPics(java.lang.String name)
public java.util.List<Pic> getPicsByMD5Sum(long md5sum)
PicsDao
getPicsByMD5Sum
in interface PicsDao
public java.util.List<Pic> getPics(java.util.List<java.lang.String> list)
PicsDao
public java.util.List<Pic> getPicsInDir(int rid, java.lang.String dirName)
PicsDao
getPicsInDir
in interface PicsDao
rid
- Root id to search underdirName
- The directory, i.e. "2002/20021225"Root
spublic java.util.List<Pic> getPicsNewerThan(java.util.Calendar calendar)
PicsDao
getPicsNewerThan
in interface PicsDao
calendar
- The date to compare toPic
s.public java.util.HashMap<java.lang.String,java.util.Date> getPicsMap()
PicsDao
getPicsMap
in interface PicsDao
public java.util.List<java.lang.String> getPicNames()
PicsDao
getPicNames
in interface PicsDao
public java.util.List<java.lang.String> getPicNamesByDateFunc(java.lang.String operator, java.lang.String operand)
PicsDao
getPicNamesByDateFunc
in interface PicsDao
operator
- 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 PicsDao
public void addPic(Pic pic)
PicsDao
Pic
to the database.public void updatePic(Pic pic) throws DataAccessException
Pic
in the databasepublic int getMaxThumbCacheDirUsed()
PicsDao
getMaxThumbCacheDirUsed
in interface PicsDao
public int getPicCount()
public int getPicCount(int rid)
PicsDao
getPicCount
in interface PicsDao
rid
- The root id to query.public int getThumbCacheFillCount(int cacheDir)
PicsDao
getThumbCacheFillCount
in interface PicsDao
cacheDir
- Which thumb cache directory to check