/** * Returns true if the this association cascade for the given cascade operation * * @param cascadeOperation The cascadeOperation * @return True if it does */ public boolean doesCascade(CascadeType cascadeOperation) { return doesCascade(new CascadeType[]{cascadeOperation}); }
private void updateToManyIndices(T nativeEntry, Object identifier, Map<Association, List<Serializable>> toManyKeys, boolean preIndex) { // now cascade onto one-to-many associations for (Association association : toManyKeys.keySet()) { if (association.doesCascade(CascadeType.PERSIST)) { final AssociationIndexer indexer = getAssociationIndexer(nativeEntry, association); if (indexer != null) { List<Serializable> foreignKeys = toManyKeys.get(association); if (preIndex) { indexer.preIndex(identifier, foreignKeys); } else { indexer.index(identifier, foreignKeys); } } } } }