public class EntityMergeSupport extends Object
Modifier and Type | Field and Description |
---|---|
protected List<EntityMergeListener> |
listeners
Listeners of merge process.
|
protected DataMap |
map |
protected NamingStrategy |
namingStrategy
Strategy for choosing names for entities, attributes and relationships
|
protected boolean |
removeMeaningfulFKs |
protected boolean |
removeMeaningfulPKs |
Constructor and Description |
---|
EntityMergeSupport(DataMap map) |
EntityMergeSupport(DataMap map,
NamingStrategy namingStrategy,
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
|
DataMap |
getMap() |
Collection<DbAttribute> |
getMeaningfulFKs(ObjEntity objEntity)
Returns a list of DbAttributes that are mapped to foreign keys.
|
NamingStrategy |
getNamingStrategy() |
protected List<DbRelationship> |
getRelationshipsToAdd(ObjEntity objEntity) |
boolean |
isRemoveMeaningfulFKs() |
void |
removeEntityMergeListener(EntityMergeListener listener)
Unregisters an EntityMergeListener
|
void |
setMap(DataMap map) |
void |
setNamingStrategy(NamingStrategy strategy)
Sets new naming strategy for reverse engineering
|
void |
setRemoveMeaningfulFKs(boolean removeMeaningfulFKs) |
boolean |
synchronizeWithDbEntities(Collection<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 DataMap map
protected boolean removeMeaningfulFKs
protected boolean removeMeaningfulPKs
protected NamingStrategy namingStrategy
protected List<EntityMergeListener> listeners
public EntityMergeSupport(DataMap map)
public EntityMergeSupport(DataMap map, NamingStrategy namingStrategy, boolean removeMeaningfulPKs)
public boolean synchronizeWithDbEntities(Collection<ObjEntity> objEntities)
public boolean synchronizeWithDbEntity(ObjEntity entity)
public Collection<DbAttribute> getMeaningfulFKs(ObjEntity objEntity)
protected List<DbAttribute> getAttributesToAdd(ObjEntity objEntity)
protected List<DbRelationship> getRelationshipsToAdd(ObjEntity objEntity)
public DataMap getMap()
public void setMap(DataMap map)
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 void setNamingStrategy(NamingStrategy strategy)
public NamingStrategy getNamingStrategy()
Copyright © 2001–2014 Apache Cayenne. All rights reserved.