Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Genesys Backend Genesys Backend
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Genesys PGRGenesys PGR
  • Genesys BackendGenesys Backend
  • Issues
  • #365
Closed
Open
Issue created Oct 25, 2018 by Matija Obreza@mobrezaOwner

Using javax.validation

The code has reference to net.sf.oval validators that are not used by the services.

64a8e983 demonstrates use of Bean Validation 1.1.0 API in services:

import javax.validation.Valid;
import org.springframework.validation.annotation.Validated;

...
	@Validated
	public <T extends Dimension<?>> T save(@Valid T dimension) {
		LOG.debug("Persisting dimension {}", dimension);
		return dimensionRepository.save(dimension);
	}

When implementing new service methods please use @Valid on model arguments where applicable.

Models use

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

...
	@NotNull
	@Size(max = 100)
	@Column(length = 100, unique = true, nullable = false)
	private String name;
Edited Oct 25, 2018 by Matija Obreza
Assignee
Assign to
Time tracking