OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
Line 120... Line 120...
120
            return res;
120
            return res;
121
        }
121
        }
122
    };
122
    };
123
 
123
 
124
    @SuppressWarnings("unchecked")
124
    @SuppressWarnings("unchecked")
125
    private static final Map<String, Number> getUndefIDs(final SQLSchema schema) {
125
    public static final Map<String, Number> getUndefIDs(final SQLSchema schema) {
126
        if (!UNDEFINED_IDs.containsKey(schema)) {
126
        if (!UNDEFINED_IDs.containsKey(schema)) {
127
            final Map<String, Number> r;
127
            final Map<String, Number> r;
128
            if (schema.contains(undefTable)) {
128
            if (schema.contains(undefTable)) {
129
                final SQLBase b = schema.getBase();
129
                final SQLBase b = schema.getBase();
130
                final SQLTable undefT = schema.getTable(undefTable);
130
                final SQLTable undefT = schema.getTable(undefTable);
Line 554... Line 554...
554
                        syntax.quoteString(this.getName()), String.valueOf(undef));
554
                        syntax.quoteString(this.getName()), String.valueOf(undef));
555
                Log.get().config("the first row (which should be the undefined):\n" + update);
555
                Log.get().config("the first row (which should be the undefined):\n" + update);
556
                return undef.intValue();
556
                return undef.intValue();
557
            }
557
            }
558
        } else if ("inDB".equals(policy)) {
558
        } else if ("inDB".equals(policy)) {
-
 
559
            return SQLRow.NONEXISTANT_ID;
-
 
560
            // FIXME : BUG A INVESTIGUER DANS LA CREATION DE MODULE throw new
559
            throw new IllegalStateException("Not in " + new SQLName(this.getDBRoot().getName(), undefTable) + " : " + this.getName());
561
            // throw new IllegalStateException("Not in " + new SQLName(this.getDBRoot().getName(),
-
 
562
            // undefTable) + " : " + this.getName());
560
        } else if (policy != null && !"nonexistant".equals(policy)) {
563
        } else if (policy != null && !"nonexistant".equals(policy)) {
561
            final int res = Integer.parseInt(policy);
564
            final int res = Integer.parseInt(policy);
562
            if (res < SQLRow.MIN_VALID_ID)
565
            if (res < SQLRow.MIN_VALID_ID)
563
                throw new IllegalStateException("ID is not valid : " + res);
566
                throw new IllegalStateException("ID is not valid : " + res);
564
            return res;
567
            return res;