All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fuchss.objectcasket.tablemodule.port.Row Maven / Gradle / Ivy

Go to download

Object Casket is a simple O/R mapper that can be used together with the Java Persistence API (JPA). The aim is to provide a simple solution for small projects to store multi-related entities in a simple manner.

There is a newer version: 0.20.17
Show newest version
package org.fuchss.objectcasket.tablemodule.port;

import org.fuchss.objectcasket.common.CasketException;
import org.fuchss.objectcasket.sqlconnector.port.StorageClass;

import java.io.Serializable;

/**
 * The abstraction of a row inside a database table.
 */
public interface Row {

	/**
	 * This operation retrieves the value of a cell inside the row.
	 *
	 * @param     - only serializable Java types can be stored in a database.
	 * @param column - the name of the column.
	 * @param clazz  - the Java type mapped to the SQL type of the column.
	 * @return the value of the cell.
	 * @throws CasketException on error. E.g. SQL type and Java type are incompatible. See
	 *                         {@link StorageClass} for possible mappings.
	 */
	 T getValue(String column, Class clazz) throws CasketException;

	/**
	 * This operation obtains the value of the primary key.
	 *
	 * @param    - only serializable Java types can be stored in a database.
	 * @param clazz - the Java type mapped to the SQL type of the primary key.
	 * @return the value of the primary key.
	 * @throws CasketException on error. E.g. if SQL type and Java type are incompatible. See
	 *                         {@link StorageClass} for possible mappings.
	 */
	 T getPk(Class clazz) throws CasketException;

	/**
	 * This operation checks whether the values inside the row are modified and not
	 * yet stored in the assigned database.
	 *
	 * @return true iff there are modified and not yet stored values.
	 */
	boolean isDirty();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy