/** * Example license header for Java files * * http://andromda.sourceforge.net/ */ // // Attention: Generated code! Do not modify by hand! // Generated by SpringDao.vsl in andromda-spring-cartridge on 09/18/2014 17:02:25-0400. Do not modify by hand!. // package org.andromda.test.5; /** * TODO: Model Documentation for org.andromda.test.5.Car * @see org.andromda.test.5.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. *

* This specific flag denotes no transformation will occur. */ public static final int TRANSFORM_NONE = 0; /** * Transforms the given results to a collection of {@link org.andromda.test.5.Car} * instances (this is useful when the returned results contains a row of data and you want just entities only). * * @param results the query results. */ public void toEntities(final java.util.Collection results); /** * 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 org.andromda.test.5.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 source * @param target */ public void toCarDetails( org.andromda.test.5.Car source, org.andromda.test.5.CarDetails target); /** * Converts this DAO's entity to an object of type {@link org.andromda.test.5.CarDetails}. * @param entity * @return org.andromda.test.5.CarDetails */ public org.andromda.test.5.CarDetails toCarDetails(org.andromda.test.5.Car entity); /** * Converts this DAO's entity to a Collection of instances of type {@link org.andromda.test.5.CarDetails}. * @param entities * @return Collection */ public Collection toCarDetailsCollection(java.util.Collection entities); /** * Converts this DAO's entity to an array of instances of type {@link org.andromda.test.5.CarDetails}. * @param entities * @return org.andromda.test.5.CarDetails[] */ public org.andromda.test.5.CarDetails[] toCarDetailsArray(java.util.Collection entities); /** * Copies the fields of {@link org.andromda.test.5.CarDetails} to the specified entity. * @param source * @param target * @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( org.andromda.test.5.CarDetails source, org.andromda.test.5.Car target, boolean copyIfNull); /** * Converts an instance of type {@link org.andromda.test.5.CarDetails} to this DAO's entity. * @param carDetails * @return org.andromda.test.5.Car */ public org.andromda.test.5.Car carDetailsToEntity(org.andromda.test.5.CarDetails carDetails); /** * Converts a Collection of instances of type {@link org.andromda.test.5.CarDetails} to this * DAO's entity. * @param instances */ public void carDetailsToEntityCollection(java.util.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 org.andromda.test.5.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 source * @param target */ public void toCarListItem( org.andromda.test.5.Car source, org.andromda.test.5.CarListItem target); /** * Converts this DAO's entity to an object of type {@link org.andromda.test.5.CarListItem}. * @param entity * @return org.andromda.test.5.CarListItem */ public org.andromda.test.5.CarListItem toCarListItem(org.andromda.test.5.Car entity); /** * Converts this DAO's entity to a Collection of instances of type {@link org.andromda.test.5.CarListItem}. * @param entities * @return Collection */ public Collection toCarListItemCollection(java.util.Collection entities); /** * Converts this DAO's entity to an array of instances of type {@link org.andromda.test.5.CarListItem}. * @param entities * @return org.andromda.test.5.CarListItem[] */ public org.andromda.test.5.CarListItem[] toCarListItemArray(java.util.Collection entities); /** * Copies the fields of {@link org.andromda.test.5.CarListItem} to the specified entity. * @param source * @param target * @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( org.andromda.test.5.CarListItem source, org.andromda.test.5.Car target, boolean copyIfNull); /** * Converts an instance of type {@link org.andromda.test.5.CarListItem} to this DAO's entity. * @param carListItem * @return org.andromda.test.5.Car */ public org.andromda.test.5.Car carListItemToEntity(org.andromda.test.5.CarListItem carListItem); /** * Converts a Collection of instances of type {@link org.andromda.test.5.CarListItem} to this * DAO's entity. * @param instances */ public void carListItemToEntityCollection(java.util.Collection instances); /** * Gets an instance of org.andromda.test.5.Car from the persistent store. * @param id * @return org.andromda.test.5.Car */ public org.andromda.test.5.Car get(java.lang.Long id); /** *

* Does the same thing as {@link #get(java.lang.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 flag to determine transformation type. * @param id the identifier of the entity to get. * @return either the entity or the object transformed from the entity. */ public Object get(int transform, java.lang.Long id); /** * Loads an instance of org.andromda.test.5.Car from the persistent store. * @param id * @return org.andromda.test.5.Car */ public org.andromda.test.5.Car load(java.lang.Long id); /** *

* Does the same thing as {@link #load(java.lang.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 flag to determine transformation type. * @param id the identifier of the entity to load. * @return either the entity or the object transformed from the entity. */ public Object load(int transform, java.lang.Long id); /** * Loads all entities of type {@link org.andromda.test.5.Car}. * * @return the loaded entities. */ public java.util.Collection loadAll(); /** *

* Does the same thing as {@link #loadAll()} 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 the flag indicating what transformation to use. * @return the loaded entities. */ public java.util.Collection loadAll(final int transform); /** *

* Does the same thing as {@link #loadAll()} with an * additional two arguments called pageNumber and pageSize. The pageNumber * argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the * page retrieved. *

* * @param pageNumber the page number to retrieve when paging results. * @param pageSize the size of the page to retrieve when paging results. * @return the loaded entities. */ public java.util.Collection loadAll(final int pageNumber, final int pageSize); /** *

* Does the same thing as {@link #loadAll(int)} with an * additional two arguments called pageNumber and pageSize. The pageNumber * argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the * page retrieved. *

* * @param transform the flag indicating what transformation to use. * @param pageNumber the page number to retrieve when paging results. * @param pageSize the size of the page to retrieve when paging results. * @return the loaded entities. */ public java.util.Collection loadAll(final int transform, final int pageNumber, final int pageSize); /** * Creates an instance of org.andromda.test.5.Car and adds it to the persistent store. * @param car * @return org.andromda.test.5.Car */ public org.andromda.test.5.Car create(org.andromda.test.5.Car car); /** *

* Does the same thing as {@link #create(org.andromda.test.5.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 */ public Object create(int transform, org.andromda.test.5.Car car); /** * Creates a new instance of org.andromda.test.5.Car and adds * from the passed in entities collection * * @param entities the collection of org.andromda.test.5.Car * instances to create. * * @return the created instances. */ public java.util.Collection create(java.util.Collection entities); /** *

* Does the same thing as {@link #create(org.andromda.test.5.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 entities (into value objects for example). By default, transformation does * not occur. *

* @param transform * @param entities * @return Collection */ public java.util.Collection create(int transform, java.util.Collection entities); /** *

* Creates a new org.andromda.test.5.Car * instance from all attributes and adds it to * the persistent store. *

* @param serial TODO: Model Documentation for org.andromda.test.5.Car.serial * @param name TODO: Model Documentation for org.andromda.test.5.Car.name * @param type TODO: Model Documentation for org.andromda.test.5.Car.type * @return org.andromda.test.5.Car */ public org.andromda.test.5.Car create( java.lang.String serial, java.lang.String name, org.andromda.test.5.CarType type); /** *

* Does the same thing as {@link #create(java.lang.String, java.lang.String, org.andromda.test.5.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 TODO: Model Documentation for org.andromda.test.5.Car.serial * @param name TODO: Model Documentation for org.andromda.test.5.Car.name * @param type TODO: Model Documentation for org.andromda.test.5.Car.type * @return org.andromda.test.5.Car */ public Object create( int transform, java.lang.String serial, java.lang.String name, org.andromda.test.5.CarType type); /** *

* Creates a new org.andromda.test.5.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 org.andromda.test.5.Car */ public org.andromda.test.5.Car create( java.lang.String name, org.andromda.test.5.Person owner, java.lang.String serial, org.andromda.test.5.CarType type); /** *

* Does the same thing as {@link #create(java.lang.String, java.lang.String, org.andromda.test.5.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 flag to determine transformation type. * @param name * @param owner * @param serial * @param type * @return Object */ public Object create( int transform, java.lang.String name, org.andromda.test.5.Person owner, java.lang.String serial, org.andromda.test.5.CarType type); /** * Updates the car instance in the persistent store. * @param car */ public void update(org.andromda.test.5.Car car); /** * Create or Update the car instance in the persistent store. * @param car * @return org.andromda.test.5.Car */ public org.andromda.test.5.Car createOrUpdate(org.andromda.test.5.Car car); /** * Updates all instances in the entities collection in the persistent store. * @param entities */ public void update(java.util.Collection entities); /** * Removes the instance of org.andromda.test.5.Car from the persistent store. * @param car */ public void remove(org.andromda.test.5.Car car); /** * Removes the instance of org.andromda.test.5.Car having the given * identifier from the persistent store. * @param id */ public void remove(java.lang.Long id); /** * Removes all entities in the given entities collection. * @param entities */ public void remove(java.util.Collection entities); /** * Returns true if all cars are currently rented. * @return boolean */ public boolean allCarsAreRented(); /** * Does the same thing as {@link #search(int, org.andromda.spring.Search)} but with an * additional two flags called pageNumber and pageSize. These flags allow you to * limit your data to a specified page number and size. * * @param transform the transformation flag. * @param pageNumber the page number in the data to retrieve * @param pageSize the size of the page to retrieve. * @param search the search object which provides the search parameters and pagination specification. * @return any found results from the search wrapped in a {@link org.andromda.spring.PaginationResult} instance. */ public org.andromda.spring.PaginationResult search(final int transform, final int pageNumber, final int pageSize, final org.andromda.spring.Search search); /** * Does the same thing as {@link #search(org.andromda.spring.Search)} but with an * additional two flags called pageNumber and pageSize. These flags allow you to * limit your data to a specified page number and size. * * @param pageNumber the page number in the data to retrieve * @param pageSize the size of the page to retrieve. * @param search the search object which provides the search parameters and pagination specification. * @return any found results from the search wrapped in a {@link org.andromda.spring.PaginationResult} instance. */ public org.andromda.spring.PaginationResult search(final int pageNumber, final int pageSize, final org.andromda.spring.Search search); /** * Does the same thing as {@link #search(org.andromda.spring.Search)} but 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 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 the transformation flag. * @param search the search object which provides the search parameters and pagination specification. * @return any found results from the search. */ public java.util.Collection search(final int transform, final org.andromda.spring.Search search); /** * Performs a search using the parameters specified in the given search object. * * @param search the search object which provides the search parameters and pagination specification. * @return any found results from the search. */ public java.util.Collection search(final org.andromda.spring.Search search); /** * Allows transformation of entities into value objects * (or something else for that matter), when the transform * flag is set to one of the constants defined in org.andromda.test.5.CarDao, please note * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself * will be returned. *

* This method will return instances of these types: *

    *
  • {@link org.andromda.test.5.Car} - {@link #TRANSFORM_NONE}
  • *
  • {@link org.andromda.test.5.CarDetails} - {@link #TRANSFORM_CARDETAILS}
  • *
  • {@link org.andromda.test.5.CarListItem} - {@link #TRANSFORM_CARLISTITEM}
  • *
* * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. * * @param transform one of the constants declared in {@link org.andromda.test.5.CarDao} * @param entity an entity that was found * @return the transformed entity (i.e. new value object, etc) * @see #transformEntities(int,java.util.Collection) */ public Object transformEntity(final int transform, final org.andromda.test.5.Car entity); /** * Transforms a collection of entities using the * {@link #transformEntity(int,org.andromda.test.5.Car)} * method. This method does not instantiate a new collection. *

* This method is to be used internally only. * * @param transform one of the constants declared in org.andromda.test.5.CarDao * @param entities the collection of entities to transform * @see #transformEntity(int,org.andromda.test.5.Car) */ public void transformEntities(final int transform, final java.util.Collection entities); /** * Searches for a single instance of org.andromda.test.5.Car. * @param serial the unique serial to be used in the search.' * @return a single instance of org.andromda.test.5.Car. */ public org.andromda.test.5.Car searchUniqueSerial(final java.lang.String serial); /** * Searches for a single instance of org.andromda.test.5.Car. * @param transform the transformation flag. * @param serial the unique serial to be used in the search. * @return a value object according the transformation flag. */ public Object searchUniqueSerial(final int transform, final java.lang.String serial); /** * Searches for a single instance of org.andromda.test.5.Car. * @param name the unique name to be used in the search.' * @return a single instance of org.andromda.test.5.Car. */ public org.andromda.test.5.Car searchUniqueName(final java.lang.String name); /** * Searches for a single instance of org.andromda.test.5.Car. * @param transform the transformation flag. * @param name the unique name to be used in the search. * @return a value object according the transformation flag. */ public Object searchUniqueName(final int transform, final java.lang.String name); /** * Searches for a single instance of org.andromda.test.5.Car. * @param type the unique type to be used in the search.' * @return a single instance of org.andromda.test.5.Car. */ public org.andromda.test.5.Car searchUniqueType(final org.andromda.test.5.CarType type); /** * Searches for a single instance of org.andromda.test.5.Car. * @param transform the transformation flag. * @param type the unique type to be used in the search. * @return a value object according the transformation flag. */ public Object searchUniqueType(final int transform, final org.andromda.test.5.CarType type); // spring-dao merge-point }