public class EntityMergeSupport extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
removeMeaningfulFKs |
protected boolean |
removeMeaningfulPKs |
protected boolean |
usePrimitives |
Constructor and Description |
---|
EntityMergeSupport(DataMap map) |
EntityMergeSupport(DataMap map,
ObjectNameGenerator nameGenerator,
boolean removeMeaningfulPKs) |
Modifier and Type | Method and Description |
---|---|
void |
addEntityMergeListener(EntityMergeListener listener)
Registers new EntityMergeListener
|
protected void |
fireAttributeAdded(ObjAttribute attr)
Notifies all listeners that an ObjAttribute was added
|
protected void |
fireRelationshipAdded(ObjRelationship rel)
Notifies all listeners that an ObjRelationship was added
|
protected List<DbAttribute> |
getAttributesToAdd(ObjEntity objEntity)
Returns a list of attributes that exist in the DbEntity, but are missing
from the ObjEntity.
|
EntityMergeListener[] |
getEntityMergeListeners()
Returns registered listeners
|
Collection<DbAttribute> |
getMeaningfulFKs(ObjEntity objEntity)
Returns a list of DbAttributes that are mapped to foreign keys.
|
ObjectNameGenerator |
getNameGenerator() |
protected List<DbRelationship> |
getRelationshipsToAdd(ObjEntity objEntity) |
boolean |
isRemoveMeaningfulFKs() |
boolean |
isUsePrimitives() |
void |
removeEntityMergeListener(EntityMergeListener listener)
Unregisters an EntityMergeListener
|
protected boolean |
removeFK(DbEntity dbEntity) |
protected boolean |
removePK(DbEntity dbEntity) |
void |
setRemoveMeaningfulFKs(boolean removeMeaningfulFKs) |
void |
setUsePrimitives(boolean usePrimitives) |
boolean |
synchronizeWithDbEntities(Iterable<ObjEntity> objEntities)
Updates each one of the collection of ObjEntities, adding attributes and
relationships based on the current state of its DbEntity.
|
boolean |
synchronizeWithDbEntity(ObjEntity entity)
Updates ObjEntity attributes and relationships based on the current state
of its DbEntity.
|
protected boolean removeMeaningfulFKs
protected boolean removeMeaningfulPKs
protected boolean usePrimitives
public EntityMergeSupport(DataMap map)
public EntityMergeSupport(DataMap map, ObjectNameGenerator nameGenerator, boolean removeMeaningfulPKs)
public boolean synchronizeWithDbEntities(Iterable<ObjEntity> objEntities)
protected boolean removePK(DbEntity dbEntity)
protected boolean removeFK(DbEntity dbEntity)
public boolean synchronizeWithDbEntity(ObjEntity entity)
public Collection<DbAttribute> getMeaningfulFKs(ObjEntity objEntity)
protected List<DbAttribute> getAttributesToAdd(ObjEntity objEntity)
protected List<DbRelationship> getRelationshipsToAdd(ObjEntity objEntity)
public boolean isRemoveMeaningfulFKs()
public void setRemoveMeaningfulFKs(boolean removeMeaningfulFKs)
public void addEntityMergeListener(EntityMergeListener listener)
public void removeEntityMergeListener(EntityMergeListener listener)
public EntityMergeListener[] getEntityMergeListeners()
protected void fireAttributeAdded(ObjAttribute attr)
protected void fireRelationshipAdded(ObjRelationship rel)
public ObjectNameGenerator getNameGenerator()
public boolean isUsePrimitives()
public void setUsePrimitives(boolean usePrimitives)
usePrimitives
- Copyright © 2001–2015 Apache Cayenne. All rights reserved.