com.jpattern.orm.query
Interface NameSolver

All Known Implementing Classes:
NullNameSolver, OrmClassToolMapNameSolver

public interface NameSolver

Author:
Francesco Cina 19/giu/2011

Method Summary
 String alias(Integer clazzId)
          Return the alias of a registered class
 void alwaysResolveWithoutAlias(boolean resolveWithoutAlias)
          If set to true always resolves the properties name without prepend the table name alias, even if the solvePropertyName is called DEFAULT is set to false.
 boolean getAlwaysResolveWithoutAlias()
          Return whether resolve the properties name without prepend the table name alias
<P> Integer
register(Class<P> clazz)
          Register a class and use the name of the class as alias to resolve the property name.
<P> Integer
register(Class<P> clazz, String alias)
          Register a class and use the passed alias parameter as alias to resolve the property name.
 String solvePropertyName(String property)
          Resolve a property in a query to his name in the database using the table alias as prefix.
 String solvePropertyName(String property, String defaultValue)
          Resolve a property in a query to his name in the database using the table alias as prefix.
 String solvePropertyNameWithoutAlias(String property)
          Resolve a property in a query to his column's related name in the database without using the table alias as prefix.
 

Method Detail

solvePropertyName

String solvePropertyName(String property)
                         throws OrmException
Resolve a property in a query to his name in the database using the table alias as prefix.

Parameters:
property -
Returns:
Throws:
OrmException

solvePropertyName

String solvePropertyName(String property,
                         String defaultValue)
                         throws OrmException
Resolve a property in a query to his name in the database using the table alias as prefix. If the property cannot be solved then the default value is returned.

Parameters:
property -
defaultValue -
Returns:
Throws:
OrmException

solvePropertyNameWithoutAlias

String solvePropertyNameWithoutAlias(String property)
                                     throws OrmException
Resolve a property in a query to his column's related name in the database without using the table alias as prefix.

Parameters:
clazz -
property -
Returns:
Throws:
OrmException

register

<P> Integer register(Class<P> clazz)
                 throws OrmException
Register a class and use the name of the class as alias to resolve the property name.

Parameters:
clazz -
Returns:
the registered class id
Throws:
OrmException

register

<P> Integer register(Class<P> clazz,
                     String alias)
                 throws OrmException
Register a class and use the passed alias parameter as alias to resolve the property name.

Parameters:
clazz -
alias -
Returns:
the registered class id
Throws:
OrmException

alias

String alias(Integer clazzId)
             throws OrmException
Return the alias of a registered class

Parameters:
clazz -
Returns:
Throws:
OrmException

alwaysResolveWithoutAlias

void alwaysResolveWithoutAlias(boolean resolveWithoutAlias)
If set to true always resolves the properties name without prepend the table name alias, even if the solvePropertyName is called DEFAULT is set to false.

Parameters:
resolveWithoutAlias -

getAlwaysResolveWithoutAlias

boolean getAlwaysResolveWithoutAlias()
Return whether resolve the properties name without prepend the table name alias

Returns:


Copyright © 2013. All Rights Reserved.