Class TagRepository

java.lang.Object
NTNU.IDATT1002.repository.AbstractRepository<Tag,​java.lang.Long>
NTNU.IDATT1002.repository.TagRepository
All Implemented Interfaces:
Repository<Tag,​java.lang.Long>

public class TagRepository
extends AbstractRepository<Tag,​java.lang.Long>
Tag Repository. Implementation of AbstractRepository which supports regular Create, Read, Update and Delete operations.
Version:
1.0 21.03.20
See Also:
AbstractRepository
  • Field Details

  • Constructor Details

    • TagRepository

      public TagRepository​(javax.persistence.EntityManager entityManager)
      Set the class type to Tag
  • Method Details

    • findOrCreate

      public Tag findOrCreate​(Tag tag)
      Retrieves a tag if found and creates it if not. Does not allow null value or blank names.
      Parameters:
      tag - the tag to retrieve
      Returns:
      the tag if found, else the newly created one.