Search in sources :

Example 1 with ForeignKey

use of org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey in project jbosstools-hibernate by jbosstools.

the class HibernateJavaManyToManyMapping method addForeignKey.

@Override
public ForeignKey addForeignKey() {
    if (getForeignKey() != null) {
        // $NON-NLS-1$
        throw new IllegalStateException("foreignKey already exists");
    }
    ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
    ForeignKey foreignKey = buildForeignKey(annotation);
    setForeignKey(foreignKey);
    return this.foreignKey;
}
Also used : ForeignKey(org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey)

Example 2 with ForeignKey

use of org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey in project jbosstools-hibernate by jbosstools.

the class HibernateJavaManyToOneMapping method addForeignKey.

@Override
public ForeignKey addForeignKey() {
    if (getForeignKey() != null) {
        // $NON-NLS-1$
        throw new IllegalStateException("foreignKey already exists");
    }
    ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
    ForeignKey foreignKey = buildForeignKey(annotation);
    setForeignKey(foreignKey);
    return this.foreignKey;
}
Also used : ForeignKey(org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey)

Example 3 with ForeignKey

use of org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey in project jbosstools-hibernate by jbosstools.

the class HibernateJavaOneToManyMapping method setForeignKey.

protected void setForeignKey(ForeignKey newForeignKey) {
    ForeignKey oldForeignKey = this.foreignKey;
    this.foreignKey = newForeignKey;
    firePropertyChanged(FOREIGN_KEY_PROPERTY, oldForeignKey, newForeignKey);
}
Also used : ForeignKey(org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey)

Example 4 with ForeignKey

use of org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey in project jbosstools-hibernate by jbosstools.

the class HibernateJavaOneToManyMapping method addForeignKey.

@Override
public ForeignKey addForeignKey() {
    if (getForeignKey() != null) {
        // $NON-NLS-1$
        throw new IllegalStateException("foreignKey already exists");
    }
    ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
    ForeignKey foreignKey = buildForeignKey(annotation);
    setForeignKey(foreignKey);
    return this.foreignKey;
}
Also used : ForeignKey(org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey)

Example 5 with ForeignKey

use of org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey in project jbosstools-hibernate by jbosstools.

the class HibernateJavaOneToOneMapping method addForeignKey.

@Override
public ForeignKey addForeignKey() {
    if (getForeignKey() != null) {
        // $NON-NLS-1$
        throw new IllegalStateException("foreignKey already exists");
    }
    ForeignKeyAnnotation annotation = (ForeignKeyAnnotation) this.getResourceAttribute().addAnnotation(ForeignKeyAnnotation.ANNOTATION_NAME);
    ForeignKey foreignKey = buildForeignKey(annotation);
    setForeignKey(foreignKey);
    return this.foreignKey;
}
Also used : ForeignKey(org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey)

Aggregations

ForeignKey (org.jboss.tools.hibernate.jpt.core.internal.context.ForeignKey)8