OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 142 Rev 156
Line 389... Line 389...
389
     * 
389
     * 
390
     * @return <code>true</code> if this is part of a foreign key that has no other fields.
390
     * @return <code>true</code> if this is part of a foreign key that has no other fields.
391
     * @see #getFieldGroup()
391
     * @see #getFieldGroup()
392
     */
392
     */
393
    public boolean isForeignKey() {
393
    public boolean isForeignKey() {
394
        final FieldGroup fieldGroup = getFieldGroup();
394
        final FieldGroup fieldGroup = getContainingFieldGroup();
395
        return fieldGroup.getKeyType() == Type.FOREIGN_KEY && fieldGroup.getSingleField() != null;
395
        return fieldGroup.getKeyType() == Type.FOREIGN_KEY && fieldGroup.getSingleField() != null;
396
    }
396
    }
397
 
397
 
398
    /**
398
    /**
399
     * To which group this field belong.
399
     * To which group this field belong.
400
     * 
400
     * 
401
     * @return the group of this field.
401
     * @return the group of this field.
402
     * @see SQLTable#getFieldGroups()
402
     * @see SQLTable#getFieldGroups()
403
     */
403
     */
404
    public FieldGroup getFieldGroup() {
404
    public FieldGroup getContainingFieldGroup() {
405
        return this.getTable().getFieldGroups().get(this.getName());
405
        return this.getTable().getFieldGroups().get(this.getName());
406
    }
406
    }
407
 
407
 
-
 
408
    /**
-
 
409
     * The group consisting of this single field.
-
 
410
     * 
-
 
411
     * @return the group consisting of this single field.
-
 
412
     * @throws IllegalStateException if this field is part of a multi-field group.
-
 
413
     */
-
 
414
    public FieldGroup getFieldGroup() throws IllegalStateException {
-
 
415
        final FieldGroup fg = this.getTable().getFieldGroups().get(this.getName());
-
 
416
        if (fg.getSingleField() == null)
-
 
417
            throw new IllegalStateException(this + " is part of a group with others : " + fg);
-
 
418
        return fg;
-
 
419
    }
-
 
420
 
408
    public final SQLTable getForeignTable() {
421
    public final SQLTable getForeignTable() {
409
        return this.getDBSystemRoot().getGraph().getForeignTable(this);
422
        return this.getDBSystemRoot().getGraph().getForeignTable(this);
410
    }
423
    }
411
 
424
 
412
    public final Link getLink() {
425
    public final Link getLink() {