Skip to content
Snippets Groups Projects
Commit b1a0c7af authored by Stian Fjæran Mogen's avatar Stian Fjæran Mogen
Browse files

Added namedquery to ImageAlbum

added findBytags and findByTitle search
parent a2c5e11e
No related branches found
No related tags found
No related merge requests found
Pipeline #77823 passed
......@@ -21,7 +21,13 @@ import java.util.Objects;
@Table(name = "image_album")
@NamedQueries({
@NamedQuery(name="ImageAlbum.findAllByUsername",
query = "SELECT ia from ImageAlbum ia WHERE ia.user.username = :username")
query = "SELECT ia from ImageAlbum ia WHERE ia.user.username = :username"),
@NamedQuery(name="ImageAlbum.findByTags",
query = "SELECT ia from ImageAlbum ia "
+ "join ia.tags tg "
+ "where tg.name = :name"),
@NamedQuery(name="Image.findByTitle",
query = "SELECT ia from ImageAlbum ia WHERE ia.title = :title")
})
public class ImageAlbum {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment