Search in sources :

Example 1 with DbAttributeListener

use of org.apache.cayenne.map.event.DbAttributeListener in project cayenne by apache.

the class DbAttribute method setPrimaryKey.

/**
 * Updates attribute "primaryKey" property.
 */
public void setPrimaryKey(boolean primaryKey) {
    if (this.primaryKey != primaryKey) {
        this.primaryKey = primaryKey;
        Entity e = this.getEntity();
        if (e instanceof DbAttributeListener) {
            ((DbAttributeListener) e).dbAttributeChanged(new AttributeEvent(this, this, e));
        }
    }
}
Also used : DbAttributeListener(org.apache.cayenne.map.event.DbAttributeListener) AttributeEvent(org.apache.cayenne.map.event.AttributeEvent)

Example 2 with DbAttributeListener

use of org.apache.cayenne.map.event.DbAttributeListener in project cayenne by apache.

the class DbAttribute method setGenerated.

/**
 * Updates attribute "generated" property.
 *
 * @since 1.2
 */
public void setGenerated(boolean generated) {
    if (this.generated != generated) {
        this.generated = generated;
        Entity e = this.getEntity();
        if (e instanceof DbAttributeListener) {
            ((DbAttributeListener) e).dbAttributeChanged(new AttributeEvent(this, this, e));
        }
    }
}
Also used : DbAttributeListener(org.apache.cayenne.map.event.DbAttributeListener) AttributeEvent(org.apache.cayenne.map.event.AttributeEvent)

Aggregations

AttributeEvent (org.apache.cayenne.map.event.AttributeEvent)2 DbAttributeListener (org.apache.cayenne.map.event.DbAttributeListener)2