com.scooterframework.orm.activerecord
Class BelongsToRelation
java.lang.Object
com.scooterframework.orm.activerecord.Relation
com.scooterframework.orm.activerecord.BelongsToRelation
public class BelongsToRelation
- extends Relation
BelongsToRelation class has information about belongs-to
relationship between objects.
For example, A belongs to B.
In belongs-to relation, foreign key is held by class A.
Fields inherited from class com.scooterframework.orm.activerecord.Relation |
associationId, BELONGS_TO_TYPE, CASCADE_DELETE, CASCADE_NONE, CASCADE_NULLIFY, CASCADE_SIMPLY_DELETE, HAS_MANY_THROUGH_TYPE, HAS_MANY_TYPE, HAS_ONE_TYPE, key, mapping, ownerClass, ownerModel, properties, REVERSE_RELATION, targetClass, targetModel, type |
Constructor Summary |
BelongsToRelation(java.lang.Class<? extends ActiveRecord> endA,
java.lang.String associationId,
java.lang.String targetModel)
|
Method Summary |
java.lang.String |
getCounterCacheName()
Returns counter cache field name |
boolean |
hasCounterCache()
Checks if counter cache field exists. |
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Set the property map. |
Methods inherited from class com.scooterframework.orm.activerecord.Relation |
allowCascade, allowCascadeDelete, allowCascadeNone, allowCascadeNullify, allowCascadeSimplyDelete, getAssociation, getConditionsString, getConditionsString, getLeftSideMappingItems, getMapping, getMappingMap, getOwnerClass, getOwnerModel, getProperties, getRelationKey, getRelationType, getReverseMapping, getReverseMappingMap, getReverseRelation, getReverseRelationName, getReverseRelationType, getRightSideMappingItems, getTargetClass, getTargetModel, setRelationKey, setTargetClass, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BelongsToRelation
public BelongsToRelation(java.lang.Class<? extends ActiveRecord> endA,
java.lang.String associationId,
java.lang.String targetModel)
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
- Set the property map.
- Overrides:
setProperties
in class Relation
hasCounterCache
public boolean hasCounterCache()
- Checks if counter cache field exists.
- Returns:
- true if exists.
getCounterCacheName
public java.lang.String getCounterCacheName()
- Returns counter cache field name
- Returns:
- String counter cache name