Hi all,
I come with my little noob question but I promise you I really tried to find the solution by myself... 5hours... Shame on me...
The model I try to make is the following one (with simplification) :
I got a lot of content that must be processed by a lot of different process.
So, each process uses a specific tag (or 2/3), ask for content not tagged, processes it and tags it.
Code:
public class Content{
@Id @GeneratedValue
private Long id;
@OneToMany
@JoinTable(name = "Content_Tags)
private Set<Tag> tags;
@Temporal(TemporalType.TIMESTAMP)
private Date addedDate;
...
}
Code:
public class Tag{
@Id @GeneratedValue
private Long id;
private String name;
...
}
So the query is something like:
Code:
select from Content c where not exists(select from Tag t where t.contentId=c.id and t.name in (:excludedList) ) order by addedDate asc limit 1
Can you write it for me with DetachedCriteria ? (or HQL but rest of the application uses Criteria...)
Thanks by advance for reading this post and all my apologize for my english nostyle.