public static String jpaCascade(PackageImportAdder importAdder, CascadeGetter... cascadeGetters) {
        if (cascadeGetters == null) {
            return "";
        }

        // we look for the first non empty conf.
        // not that it could be a NONE conf => user does not want any cascade.

        for (CascadeGetter cascadeGetter : cascadeGetters) {
            if (cascadeGetter != null) {
                List<Cascade> cascadeConf = cascadeGetter.getCascades();

                if (cascadeConf != null && cascadeConf.size() > 0) {
                    List<CascadeType> cascades = convertJpaCascade(cascadeConf);
                    // we could have removed the NONE element, so we check for emptiness.
                    if (!cascades.isEmpty()) {
                        for (CascadeType ct : cascades) {
                            importAdder.addImport("static javax.persistence.CascadeType." + ct.name());
                        }

                        AttributeBuilder ab = new AttributeBuilder();
                        ab.add("cascade", convertJpaCascadeToStrings(cascades));
                        return ab.getAttributes();
                    } else {
                        return ""; // there was 1 element: NONE => user does not want anything, we bail out.
                    }
                }
            }
        }

        return "";
    }
public static String jpaCascade ( PackageImportAdder importAdder , CascadeGetter ... cascadeGetters ) { if ( cascadeGetters == null ) { return "" ; } for ( CascadeGetter cascadeGetter : cascadeGetters ) { if ( cascadeGetter != null ) { List < Cascade > cascadeConf = cascadeGetter . getCascades ( ) ; if ( cascadeConf != null && cascadeConf . size ( ) > 0 ) { List < CascadeType > cascades = convertJpaCascade ( cascadeConf ) ; if ( ! cascades . isEmpty ( ) ) { for ( CascadeType ct : cascades ) { importAdder . addImport ( "static javax.persistence.CascadeType." + ct . name ( ) ) ; } AttributeBuilder ab = new AttributeBuilder ( ) ; ab . add ( "cascade" , convertJpaCascadeToStrings ( cascades ) ) ; return ab . getAttributes ( ) ; } else { return "" ; } } } } return "" ; }
------------------------------------------