forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the content of assignment conversion to the latest version of …
…that in post-2-4 branch git-svn-id: https://source.sakaiproject.org/svn/assignment/trunk@40117 66ffb92e-73f9-0310-93c1-f5514f145a0a
- Loading branch information
Showing
16 changed files
with
1,748 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...mpl/src/java/org/sakaiproject/assignment/impl/conversion/api/SchemaConversionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/********************************************************************************** | ||
* $URL: $ | ||
* $Id: $ | ||
*********************************************************************************** | ||
* | ||
* Copyright (c) 2003, 2004, 2005, 2006, 2007 The Sakai Foundation. | ||
* | ||
* Licensed under the Educational Community License, Version 1.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.opensource.org/licenses/ecl1.php | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
**********************************************************************************/ | ||
|
||
package org.sakaiproject.assignment.impl.conversion.api; | ||
|
||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
/** | ||
* @author ieb | ||
*/ | ||
public interface SchemaConversionHandler | ||
{ | ||
|
||
/** | ||
* Retrievs a single source object form a ResultSet, returns null if the | ||
* source record does not require conversion the result set was produiced | ||
* from selectRecord SQL | ||
* | ||
* @param id | ||
* @param rs | ||
* @return | ||
* @throws SQLException | ||
*/ | ||
Object getSource(String id, ResultSet rs) throws SQLException; | ||
|
||
/** | ||
* Converts the source object and populates the preapred statement, the | ||
* prepared statement is from getUpdateRecord. | ||
* | ||
* @param id | ||
* @param source | ||
* @param updateRecord | ||
* @throws SQLException | ||
*/ | ||
boolean convertSource(String id, Object source, PreparedStatement updateRecord) | ||
throws SQLException; | ||
|
||
/** | ||
* Validate that the source object before conversion is the same as the | ||
* result object, after conversion, re-read from the database | ||
* | ||
* @param id | ||
* the ID of the record | ||
* @param source | ||
* the source object created by the same implementation | ||
* @param result | ||
* the result object created by the same implementation | ||
* @throws Exception | ||
* if the result is not equivalent to the source, at which point the | ||
* whole transaction will be rolled back | ||
*/ | ||
void validate(String id, Object source, Object result) throws Exception; | ||
|
||
/** | ||
* Get the source object for the validation record | ||
* @param id | ||
* @param rs | ||
* @return | ||
* @throws SQLException | ||
*/ | ||
Object getValidateSource(String id, ResultSet rs) throws SQLException; | ||
|
||
/** | ||
* Get the db driver | ||
* @return | ||
*/ | ||
String getDbDriver(); | ||
|
||
/** | ||
* Set the db driver string | ||
* @param dbDriver | ||
* @return | ||
*/ | ||
void setDbDriver(String dbDriver); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.