[ 
https://issues.apache.org/jira/browse/TAPESTRY-2254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAPESTRY-2254.
------------------------------------------

    Resolution: Duplicate
      Assignee: Howard M. Lewis Ship

Fixed as TAPESTRY-2260.

> ValueEncoders created by HibernateEntityValueEncoder produces exceptions on 
> empty clientValue
> ---------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2254
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2254
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-hibernate
>    Affects Versions: 5.0.12
>            Reporter: Kristian Marinkovic
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>
> the toValue() method of the ValueEncoder created by the 
> HibernateEntityValueEncoder service tries coercing the clientValue to the 
> primary key field type even if it is empty. this creates a coercion 
> exception. 
>       public E toValue(String clientValue) {
>               Class<?> idType = _idGetter.getReturnType();
>               // cannot coerce if clientValue is empty 
>               Object id = _typeCoercer.coerce(clientValue, idType);
>               Serializable ser = Defense.cast(id, Serializable.class, "id");
>               return (E)_session.get(_entityClass, ser);
>       }
> the created ValueEncoder should return null if the client Value is empty/null
> this situation arises when a select component is submitted with the blank 
> option selected (see blankOption parameter of select component). as long as 
> there is no required validator associated with the select box null is a valid 
> value (a list of entities is used for the SelectModel). 
> furthermore there is no way to override/decorate the 
> HibernateEntityValueEncoder nor to exclude certain entities from having 
> ValueEncoders created. this is useful when custom ValueEncoders are provided. 
> in existing applications the custom ValueEncoders for the entities are 
> quietly ignored.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to