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;
}
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;
}
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);
}
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;
}
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;
}
Aggregations