br.com.arsmachina.tapestrycrud.services
Interface PrimaryKeyTypeService


public interface PrimaryKeyTypeService

Service that informs the primary key field type of a given entity class. Implementations are not obliged to provide this service for any entity class

Author:
Thiago H. de Paula Figueiredo

Method Summary
 String getPrimaryKeyPropertyName(Class entityClass)
          Returns the name of the property used as primary key in a given class.
 Class getPrimaryKeyType(Class entityClass)
           Returns the Class instance representing the primary key field type for a given entity class.
 

Method Detail

getPrimaryKeyType

Class getPrimaryKeyType(Class entityClass)

Returns the Class instance representing the primary key field type for a given entity class. It must return null if the given class is not supported.

The primary key field type of a given class may not be the one used as primary key column in the database. This can be used to provide prettier URLs for ActionLinks, EventLinks or PageLinks (when no ActivationContextEncoder is explicitly provided and one is automatically created from a PrimaryKeyEncoder).

Parameters:
entityClass - a Class instance. It cannot be null.
Returns:
a Class or null.

getPrimaryKeyPropertyName

String getPrimaryKeyPropertyName(Class entityClass)
Returns the name of the property used as primary key in a given class. The same assumptions made to getPrimaryKeyType(Class) applies here.

Parameters:
entityClass - a Class instance. It cannot be null.
Returns:
a String or null.


Copyright © 2008-2009 Thiago H. de Paula Figueiredo. All Rights Reserved.