package com.abstratt.kirra;

/**
 * Represents a property.
 */
public class Property extends DataElement {

    private static final long serialVersionUID = 1;

    protected boolean unique;
    protected Object defaultValue;

    public Property() {
    }

    /**
     * An auto-generated property has its value automatically assigned.
     */
    public boolean isAutoGenerated() {
        return isUnique() && !isInitializable() && !isEditable();
    }

    /**
     * A unique property does not allow duplicated values.
     */
    public boolean isUnique() {
        return unique;
    }

    public void setUnique(boolean unique) {
        this.unique = unique;
    }
    
    public Object getDefaultValue() {
        return defaultValue;
    }
    
    public void setDefaultValue(Object value) {
        this.defaultValue = value;
    }
}
package com.abstratt.kirra;

/**
 * Represents a property.
 */
public class Property extends DataElement {

    private static final long serialVersionUID = 1;

    protected boolean unique;
    protected Object defaultValue;

	protected boolean autoGenerated;

    public Property() {
    }

    /**
     * An auto-generated property has its value automatically assigned.
     */
    public boolean isAutoGenerated() {
		return autoGenerated;
    }
    
    public void setAutoGenerated(boolean autoGenerated) {
		this.autoGenerated = autoGenerated;
	}

    /**
     * A unique property does not allow duplicated values.
     */
    public boolean isUnique() {
        return unique;
    }

    public void setUnique(boolean unique) {
        this.unique = unique;
    }
    
    public Object getDefaultValue() {
        return defaultValue;
    }
    
    public void setDefaultValue(Object value) {
        this.defaultValue = value;
    }
}
support for property.autoGenerated