
org.ioc.commons.japtsy.server.model.biz.EntityIdResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons-japtsy Show documentation
Show all versions of ioc-commons-japtsy Show documentation
Common classes required for Java Transfer Protocol System communication
package org.ioc.commons.japtsy.server.model.biz;
import org.ioc.commons.japtsy.shared.model.biz.JAPTSYServiceException;
/**
* The {@link EntityIdResolver} is used by the JAPTSY system to translate entity
* primary key (id) into string format and viceversa.
*
* @author Jesús Lunar Pérez
*
*/
public interface EntityIdResolver {
/**
* Gets an unique string value which represents the entity id passed as
* parameter.
*
* It is the responsability of the implementations to ensure the returned
* string will represent one and only one entity in the system.
*
* @param entity
* id The entity id. It can be whichever objects that represents
* an entity id, i.e. a java type such as String, Integer, Enum,
* etc. or a custom composed id class.
* @return Unique string value.
* @throws JAPTSYServiceException
* Something was wrong
*/
String getEntityIdAsString(Object entity) throws JAPTSYServiceException;
/**
* Gets the entity id represented by unique id string.
*
* @param idAsString
* An unique entity id got previously by
* {@link EntityIdResolver#getEntityIdAsString(Object)}.
* @return An entity id instance.
* @throws JAPTSYServiceException
* Something was wrong
*/
Object getEntityIdFromString(String idAsString) throws JAPTSYServiceException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy