Details

    • Type: New Feature
    • Status: Closed
    • Priority: 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 Mark Pollack added a comment -

        This can be integrated into the eventing support in MongoTemplate

        Show
        mark.pollack Mark Pollack added a comment - This can be integrated into the eventing support in MongoTemplate
        Hide
        mark.pollack Mark Pollack added a comment -
        Show
        mark.pollack 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 Maciej Walkowiak added a comment -
        Show
        maciej.walkowiak Maciej Walkowiak added a comment - Pull request waiting for approval: https://github.com/SpringSource/spring-data-mongodb/pull/2
        Hide
        olivergierke 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
        olivergierke 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
        nisabek 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
        nisabek 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
        olivergierke 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
        olivergierke 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:
            olivergierke Oliver Gierke
            Reporter:
            mark.pollack Mark Pollack
            Last updater:
            Trevor Marshall
          • 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