| java.lang.Object org.apache.roller.business.utils.ConsistencyCheck
ConsistencyCheck | public class ConsistencyCheck (Code) | | Roller database consistency checker.
Don't run this unless you know what you are doing!
Configuration:
Program looks in current directory for db.properties file with database
connection properties driverClassName and connectionUrl.
Program expects JDBC driver jar to be on classpath.
Usage:
java -cp ./WEB-INF/lib/rollerbeans.jar org.apache.roller.business.utils.ConsistencyCheck
Options:
-v Verbose
-purge Delete orphans
|
Method Summary | |
public static void | correctWebsites(Connection con) | public static Connection | createConnection(Properties props, String prefix) | public static void | findAndDeleteOrphans(Connection con, boolean delete, boolean verbose) Find and optionally delete all safely deletable orphans. | public static List | findOrphans(Connection con, String manytable, String fkname, String onetable, boolean delete, boolean verbose) Find orphans, records in a manytable that refer to a onetable that
no longer exists.
Parameters: con - Database connection to be used. Parameters: manytable - Name of the manytable. Parameters: fkname - Name of the foreign key field in the manytable. Parameters: onetable - Name of the onetable. Parameters: delete - True if orphans in manytable are to be deleted. | public static String | getRootCategoryId(Connection con, String websiteid) | public static void | main(String[] args) Consistency checker, find and optionally delete orphans. |
createConnection | public static Connection createConnection(Properties props, String prefix) throws Exception(Code) | | Create connection based on properties:
- driverClassName
- connectionUrl
- userName
- password
|
findAndDeleteOrphans | public static void findAndDeleteOrphans(Connection con, boolean delete, boolean verbose) throws SQLException(Code) | | Find and optionally delete all safely deletable orphans.
|
findOrphans | public static List findOrphans(Connection con, String manytable, String fkname, String onetable, boolean delete, boolean verbose) throws SQLException(Code) | | Find orphans, records in a manytable that refer to a onetable that
no longer exists.
Parameters: con - Database connection to be used. Parameters: manytable - Name of the manytable. Parameters: fkname - Name of the foreign key field in the manytable. Parameters: onetable - Name of the onetable. Parameters: delete - True if orphans in manytable are to be deleted. List of orphans found (will be empty if delete is true. throws: SQLException - |
main | public static void main(String[] args) throws Exception(Code) | | Consistency checker, find and optionally delete orphans.
|
|
|