I have a entity as bellow :-
@Entity @Table(name = "agent") public class Agent implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long Id; private List<SocialMedia> SocialMedias; public Agent() { } public Long getId() { return Id; } public List<SocialMedia> getSocialMedias() { return SocialMedias; } public void setSocialMedias(List<SocialMedia> SocialMedias) { this.SocialMedias = SocialMedias; } public enum SocialMedia { Facebook, Twitter, Instagram, Whatsapp } }
I need all the agents who have active in Facebook and Twitter. what should be the query?
Thanks