| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| RowReader |
|
| 1.0;1 |
| 1 | package org.apache.ojb.broker.accesslayer; | |
| 2 | ||
| 3 | /* Copyright 2002-2005 The Apache Software Foundation | |
| 4 | * | |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 6 | * you may not use this file except in compliance with the License. | |
| 7 | * You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | ||
| 18 | import org.apache.ojb.broker.metadata.ClassDescriptor; | |
| 19 | ||
| 20 | import java.io.Serializable; | |
| 21 | import java.sql.ResultSet; | |
| 22 | import java.util.Map; | |
| 23 | ||
| 24 | /** | |
| 25 | * @version $Id: RowReader.java,v 1.1 2007-08-24 22:17:30 ewestfal Exp $ | |
| 26 | */ | |
| 27 | public interface RowReader extends Serializable | |
| 28 | { | |
| 29 | static final long serialVersionUID = -1283322922537162249L; /** | |
| 30 | * materialize a single object from the values of the Map row. | |
| 31 | * the implementor of this class must not care for materializing | |
| 32 | * references or collection attributes, this is done later! | |
| 33 | * @param row the Map containing the new values | |
| 34 | * @return a properly created instance. | |
| 35 | */ | |
| 36 | public Object readObjectFrom(Map row); | |
| 37 | ||
| 38 | /** | |
| 39 | * refresh an existing instance from the values of the Map row. | |
| 40 | * @param instance the instance to refresh | |
| 41 | * @param row the Map containing the new values | |
| 42 | */ | |
| 43 | public void refreshObject(Object instance, Map row); | |
| 44 | ||
| 45 | ||
| 46 | /** | |
| 47 | * Read all fields from the current ResultRow into the Object[] row.# | |
| 48 | * ConversionStrategies are applied here! | |
| 49 | */ | |
| 50 | public void readObjectArrayFrom(ResultSetAndStatement rs, Map row); | |
| 51 | ||
| 52 | /** | |
| 53 | * Read primary key fields from the current ResultRow into the Object[] row.# | |
| 54 | * ConversionStrategies are applied here! | |
| 55 | */ | |
| 56 | public void readPkValuesFrom(ResultSetAndStatement rs, Map row); | |
| 57 | ||
| 58 | /** | |
| 59 | * Set the descriptor this <i>RowReader</i> worked with. | |
| 60 | */ | |
| 61 | public void setClassDescriptor(ClassDescriptor cld); | |
| 62 | ||
| 63 | /** | |
| 64 | * Returns the associated {@link org.apache.ojb.broker.metadata.ClassDescriptor} | |
| 65 | */ | |
| 66 | public ClassDescriptor getClassDescriptor(); | |
| 67 | } |