@Override public void check(final MappedClass mc, final Set<ConstraintViolation> ve) { if (mc.getEmbeddedAnnotation() != null && mc.getIdField() != null) { ve.add( new ConstraintViolation( Level.FATAL, mc, getClass(), "@" + Embedded.class.getSimpleName() + " classes cannot specify a @Id field")); } }
private List<Index> collectIndexes(final MappedClass mc, final List<MappedClass> parentMCs) { if (parentMCs.contains(mc) || mc.getEmbeddedAnnotation() != null && parentMCs.isEmpty()) { return emptyList(); } List<Index> indexes = collectTopLevelIndexes(mc); indexes.addAll(collectFieldIndexes(mc)); indexes.addAll(collectNestedIndexes(mc, parentMCs)); return indexes; }