public class ContentImageLanguageDAO extends ContentImage {
private static final long serialVersionUID = 3398298594106849624L;
public static ContentImageLanguage load(String siteId, Long imageId) throws SecurityException, Exception {
EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
ContentImageLanguage contentImageLanguage = (ContentImageLanguage) em.find(ContentImageLanguage.class, imageId);
if (!contentImageLanguage.getContentLanguage().getContent().getSiteId().equals(siteId)) {
throw new SecurityException();
}
return contentImageLanguage;
}