// license-header java merge-point
//
// Attention: Generated code! Do not modify by hand!
// Generated by DaoLocal.vsl in andromda-ejb3-cartridge on 09/18/2014 16:56:08.
//
package org.andromda.test.howto6.a;
import java.util.Collection;
import java.util.List;
/**
* @see Car
*/
public interface CarDao
{
/**
* This constant is used as a transformation flag; entities can be converted automatically into value objects
* or other types, different methods in a class implementing this interface support this feature: look for
* an int
parameter called transform
.
*
int
parameter called transform
.
*
* This specific flag denotes entities must be transformed into objects of type
* {@link CarDetails}.
*/
public static final int TRANSFORM_CARDETAILS = 1;
/**
* Copies the fields of the specified entity to the target value object. This method is similar to
* toCarDetails(), but it does not handle any attributes in the target
* value object that are "read-only" (as those do not have setter methods exposed).
* @param sourceEntity
* @param targetVO
*/
public void toCarDetails(
Car sourceEntity,
CarDetails targetVO);
/**
* Converts this DAO's entity to an object of type {@link CarDetails}.
* @param entity
* @return CarDetails
*/
public CarDetails toCarDetails(Car entity);
/**
* Converts this DAO's entity to a Collection of instances of type {@link CarDetails}.
* @param entities
*/
public void toCarDetailsCollection(Collection entities);
/**
* Copies the fields of {@link CarDetails} to the specified entity.
* @param sourceVO
* @param targetEntity
* @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE,
* it will be copied regardless of its value.
*/
public void carDetailsToEntity(
CarDetails sourceVO,
Car targetEntity,
boolean copyIfNull);
/**
* Converts an instance of type {@link CarDetails} to this DAO's entity.
* @param carDetails
* @return Car
*/
public Car carDetailsToEntity(CarDetails carDetails);
/**
* Converts a Collection of instances of type {@link CarDetails} to this
* DAO's entity.
* @param instances
*/
public void carDetailsToEntityCollection(Collection instances);
/**
* This constant is used as a transformation flag; entities can be converted automatically into value objects
* or other types, different methods in a class implementing this interface support this feature: look for
* an int
parameter called transform
.
*
* This specific flag denotes entities must be transformed into objects of type
* {@link CarListItem}.
*/
public static final int TRANSFORM_CARLISTITEM = 2;
/**
* Copies the fields of the specified entity to the target value object. This method is similar to
* toCarListItem(), but it does not handle any attributes in the target
* value object that are "read-only" (as those do not have setter methods exposed).
* @param sourceEntity
* @param targetVO
*/
public void toCarListItem(
Car sourceEntity,
CarListItem targetVO);
/**
* Converts this DAO's entity to an object of type {@link CarListItem}.
* @param entity
* @return CarListItem
*/
public CarListItem toCarListItem(Car entity);
/**
* Converts this DAO's entity to a Collection of instances of type {@link CarListItem}.
* @param entities
*/
public void toCarListItemCollection(Collection entities);
/**
* Copies the fields of {@link CarListItem} to the specified entity.
* @param sourceVO
* @param targetEntity
* @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE,
* it will be copied regardless of its value.
*/
public void carListItemToEntity(
CarListItem sourceVO,
Car targetEntity,
boolean copyIfNull);
/**
* Converts an instance of type {@link CarListItem} to this DAO's entity.
* @param carListItem
* @return Car
*/
public Car carListItemToEntity(CarListItem carListItem);
/**
* Converts a Collection of instances of type {@link CarListItem} to this
* DAO's entity.
* @param instances
*/
public void carListItemToEntityCollection(Collection instances);
/**
* Loads an instance of Car from the persistent store.
* @param id Long identifier part of the composite PK of the entity to load.
* @return Car
* @throws CarDaoException
*/
public Car load(Long id)
throws CarDaoException;
/**
* Does the same thing as {@link #load(Long)} with an
* additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
* the returned entity will NOT be transformed. If this flag is any of the other constants
* defined in this class then the result WILL BE passed through an operation which can
* optionally transform the entity (into a value object for example). By default, transformation does
* not occur.
*
* @param transform int transformation flag
* @param id Long identifier part of the composite PK of the entity to load.
* @return either the entity or the object transformed from the entity.
* @throws CarDaoException
*/
public Object load(int transform, Long id)
throws CarDaoException;
/**
* Loads all entities of type {@link Car}.
*
* @return the loaded entities.
* @throws CarDaoException
*/
public Collectiontransform
. If this flag is set to TRANSFORM_NONE
then
* the returned entity will NOT be transformed. If this flag is any of the other constants
* defined here then the result WILL BE passed through an operation which can optionally
* transform the entity (into a value object for example). By default, transformation does
* not occur.
*
* @param transform the flag indicating what transformation to use.
* @return Collection of the loaded entities.
* @throws CarDaoException
*/
@SuppressWarnings("rawtypes")
public Collection loadAll(final int transform)
throws CarDaoException;
/**
* Creates an instance of Car and adds it to the persistent store.
* @param car
* @return Car
* @throws CarDaoException
*/
public Car create(Car car)
throws CarDaoException;
/**
* Does the same thing as {@link #create(Car)} with an
* additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
* the returned entity will NOT be transformed. If this flag is any of the other constants
* defined here then the result WILL BE passed through an operation which can optionally
* transform the entity (into a value object for example). By default, transformation does
* not occur.
*
* @param transform
* @param car
* @return Object
* @throws CarDaoException
*/
public Object create(int transform, Car car)
throws CarDaoException;
/**
* Creates a new instance of Car and adds
* from the passed in entities
collection
*
* @param entities the collection of Car
* instances to create.
* @return the created instances. Collectiontransform
. If this flag is set to TRANSFORM_NONE
then
* the returned entity will NOT be transformed. If this flag is any of the other constants
* defined here then the result WILL BE passed through an operation which can optionally
* transform the entities (into value objects for example). By default, transformation does
* not occur.
*
* @param transform
* @param entities
* @return the created instances. Collection
* @throws CarDaoException
*/
@SuppressWarnings({"rawtypes"})
public Collection create(int transform, CollectionCar
* instance from all attributes and adds it to
* the persistent store.
* @param serial
* @param name
* @param type
* @return the created instances. Car
* @throws CarDaoException
*/
public Car create(
String serial,
String name,
CarType type)
throws CarDaoException;
/**
* Does the same thing as {@link #create(String, String, CarType)} with an
* additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
* the returned entity will NOT be transformed. If this flag is any of the other constants
* defined here then the result WILL BE passed through an operation which can optionally
* transform the entity (into a value object for example). By default, transformation does
* not occur.
*
* @param transform
* @param serial
* @param name
* @param type
* @return the created instances. Object
* @throws CarDaoException
*/
public Object create(
int transform,
String serial,
String name,
CarType type)
throws CarDaoException;
/**
* Creates a new Car
* instance from only required properties (attributes
* and association ends) and adds it to the persistent store.
*
* @param name
* @param owner
* @param serial
* @param type
* @return the created instance. Car
* @throws CarDaoException
*/
public Car create(
String name,
Person owner,
String serial,
CarType type)
throws CarDaoException;
/**
* Does the same thing as {@link #create(String, String, CarType)} with an
* additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
* the returned entity will NOTWILL BE passed through an operation which can optionally
* transform the entity (into a value object for example). By default, transformation does
* not occur.
*
* @param transform
* @param name
* @param owner
* @param serial
* @param type
* @return the created instance. Object
* @throws CarDaoException
*/
public Object create(
int transform,
String name,
Person owner,
String serial,
CarType type)
throws CarDaoException;
/**
* Updates the car
instance in the persistent store.
* @param car
* @throws CarDaoException
*/
public void update(Car car)
throws CarDaoException;
/**
* Updates all instances in the entities
collection in the persistent store.
* @param entities
* @throws CarDaoException
*/
public void update(Collectionidentifier
from the persistent store.
* @param id
* @throws CarDaoException
*/
public void remove(Long id)
throws CarDaoException;
/**
* Removes all entities in the given entities collection.
* @param entities
* @throws CarDaoException
*/
public void remove(Collection entities)
throws CarDaoException;
/**
*
* TODO: Model Documentation for findByType
*
* @param type
* @return List
* @throws CarDaoException
*/
public List findByType(CarType type)
throws CarDaoException;
/**
* Does the same thing as {@link #findByType(CarType)} with an
* additional argument called queryString
.
* @param queryString String allows you to override the query string defined in {@link #findByType(CarType)}
* @param type
* @return List
* @throws CarDaoException
*/
public List findByType(String queryString, CarType type)
throws CarDaoException;
/**
* Does the same thing as {@link #findByType(CarType)} with an
* additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
* finder results will NOT be transformed during retrieval.
* If this flag is any of the other constants defined here
* then finder results WILL BE passed through an operation which can optionally
* transform the entities (into value objects for example). By default, transformation does
* not occur.
* @param transform int Transform finder results during retrieval
* @param type
* @return List
* @throws CarDaoException
*/
public List findByType(int transform, CarType type)
throws CarDaoException;
/**
* Does the same thing as {@link #findByType(int, CarType)} with an
* additional argument called queryString
. This queryString
* argument allows you to override the query string defined in {@link #findByType(int, CarType)}.
* @param transform int Transform finder results during retrieval
* @param queryString String allows you to override the query string defined in {@link #findByType(CarType)}
* @param type
* @return List
* @throws CarDaoException
*/
public List findByType(int transform, String queryString, CarType type)
throws CarDaoException;
/**
*
* Returns true if all cars are currently rented.
*
* @return boolean
*/
public boolean allCarsAreRented();
}