Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0 M2
    • Fix Version/s: 1.1 M1
    • Component/s: Core
    • Labels:
      None

      Description

      Spring 3.0 supports JSR-303. If

      <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>

      is defined, we can ask the container for the validator (is there an Aware interface?) and then perform validation within MongoTemplate methods that take a POJO for Create, update, or delete operations.

        Activity

        Hide
        Mark Pollack added a comment -

        This can be integrated into the eventing support in MongoTemplate

        Show
        Mark Pollack added a comment - This can be integrated into the eventing support in MongoTemplate
        Hide
        Mark Pollack added a comment -
        Show
        Mark Pollack added a comment - Mr. Walkowiak has provided the glue code for this http://maciejwalkowiak.pl/blog/2012/04/20/jsr-303-validation-with-spring-data-mongodb/
        Hide
        Maciej Walkowiak added a comment -
        Show
        Maciej Walkowiak added a comment - Pull request waiting for approval: https://github.com/SpringSource/spring-data-mongodb/pull/2
        Hide
        Oliver Gierke added a comment -

        Fixed by integrating Maciej's contribution. We now auto detect the presence of javax.validation API on the classpath and register an approrpiate Validator as well as an event listener that triggers validaton right before persisting the entities.

        Show
        Oliver Gierke added a comment - Fixed by integrating Maciej's contribution. We now auto detect the presence of javax.validation API on the classpath and register an approrpiate Validator as well as an event listener that triggers validaton right before persisting the entities.
        Hide
        Nune Isabekyan added a comment -

        Hi,

        I cannot access this feature using latest - 1.0.2 GA version as it contains spring-mongo-1.0.xsd instead of needed spring-mongo-1.1.xsd.

        Thanks in advance.
        Regards,
        Nune

        Show
        Nune Isabekyan added a comment - Hi, I cannot access this feature using latest - 1.0.2 GA version as it contains spring-mongo-1.0.xsd instead of needed spring-mongo-1.1.xsd. Thanks in advance. Regards, Nune
        Hide
        Oliver Gierke added a comment -

        That's right as the support will was introduced in the 1.1.x timeline and will not be back-ported to the 1.0.x one. So you have to use the latest 1.1 version to get access to it. Please refrain from re-opening tickets that have been closed against an already released version as the ticket has already made it into the changelog already. Create a new ticket in case needed then.

        Show
        Oliver Gierke added a comment - That's right as the support will was introduced in the 1.1.x timeline and will not be back-ported to the 1.0.x one. So you have to use the latest 1.1 version to get access to it. Please refrain from re-opening tickets that have been closed against an already released version as the ticket has already made it into the changelog already. Create a new ticket in case needed then.

          People

          • Assignee:
            Oliver Gierke
            Reporter:
            Mark Pollack
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0d
              0d
              Remaining:
              Remaining Estimate - 0d
              0d
              Logged:
              Time Spent - 1h 20m
              1h 20m