You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/01/30 09:24:11 UTC
[jira] [Commented] (ISIS-624) Use
javax.validation.constraints.Digits to specify length and scale for
BigDecimal action parameters (to avoid JDO exceptions later).
[ https://issues.apache.org/jira/browse/ISIS-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13886386#comment-13886386 ]
ASF subversion and git services commented on ISIS-624:
------------------------------------------------------
Commit 6b014b328551c1b5c1b8451128a1e98e4692d521 in branch refs/heads/master from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=6b014b3 ]
ISIS-661, also fixes for ISIS-660,ISIS-658,ISIS-624.
ISIS-661: BackgroundTaskService
- with JDO implementation
ISIS-660: refinements to Interaction context
- and rename Transactional to HasTransactionId
- introduce non-API for MementoServiceDefault to switch off encoding
ISIS-658: fix length for timestamp panel, show milliseconds
- and extend WicketViewerSettings, to have a timestamp setting property
ISIS-624: fix for @Digits, honour scale when *not* annotated with @Column
In addition:
- fix for wicket viewer, show @Prototype actions if associated with properties
(ie as additional links)
> Use javax.validation.constraints.Digits to specify length and scale for BigDecimal action parameters (to avoid JDO exceptions later).
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISIS-624
> URL: https://issues.apache.org/jira/browse/ISIS-624
> Project: Isis
> Issue Type: New Feature
> Components: Core
> Affects Versions: core-1.3.0
> Reporter: Dan Haywood
> Assignee: Dan Haywood
> Priority: Minor
> Fix For: core-1.4.0
>
>
> Using the JDO @Column annotation the length/scale of properties can be specified. However, there is no capability to capture these semantics for action parameters (and the @Column annotation cannot be specified for parameters, even if we thought that were a good idea).
> With no semantics, Isis currently infers the scale of a BigDecimal from the entered input. For example, entering "123.45" will parse to a BD with scale of 2, entering "123.4567" will parse to a BD with scale of 4.
> The problem, then, is that if a BD with too large a scale is assigned to a property with a lower scale, then JDO will throw an exception.
> So this ticket is to bring in a dependency on beanval 1.1 (JSR-349) such that we can reuse the semantics of its @javax.validation.constraint.Digits annotation:
> public class ToDoItem
> @javax.jdo.annotations.Column(length=10, scale=2)
> private Cost cost;
> public void updateCost(@javax.validation.constraint.Digits(integer=8,fraction=2) BigDecimal newCost) {
> setCost(cost);
> }
> }
> In addition, it should be possible to add this annotation to properties too. If there is a mismatch between JDO and the Isis annotaitons, then a metamodel validation exception should be thrown.
> ~~~
> side note: ISIS-491 is to more fully integration bean validation... this is only a very small step.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)