Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3947

Add JSR-303 validation jars to OpenMRS core

    XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      See https://groups.google.com/a/openmrs.org/d/msg/dev/9uaA3jSKFLc/iAGVBFnEGvoJ

      I've been working with Darius on modifying the appframework module, and as part of that I required bean validation to happen in the code (to verify that the setup was correct and the domain objects were being created correctly).

      I incorporated the JSR303 spec for doing bean validation in java, which has been adopted as the standard way of doing bean validation.

      To incorporate this, we need to have the standards interface (javax.validation.*) which defines the standard interfaces and contract for the bean validation and one implementation of it in the classpath. These are available in the form of two jars as specified by the following dependencies.

      <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>1.0.0.GA</version>
      </dependency>
      <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
      <version>4.3.0.Final</version>
      </dependency>

      The former pulls in the standards interface whereas the latter brings in the implementation.

      It is important to include these in openmrs-core and it cannot be pulled in through the modules due to the way classloader hierarchy is structured. The beans are pulled in via spring which comes from the core classloader and it can't access the module classloaders while loading the class, as they are children. So for now it would be good to include them into core.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              nutsiepully Pulkit Bhuwalka
              Reporter:
              nutsiepully Pulkit Bhuwalka
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: