Package com.im.df.api.ddl
Interface DFContainer<E extends DFItem>
-
public interface DFContainer<E extends DFItem>
Generic container for anyDFItem
s list. Events should be fired as property changes on the ownerDFItem
. (e.g.DFEntity.PROP_FIELDS
property change event inDFEntity
when new field is added or some field is removed)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description E
findItemById(java.lang.String id)
Find item by its id (seeDFItem.getId()
).E
findItemByName(java.lang.String name)
Find item by its name (seeDFItem.getName()
).java.util.List<java.lang.String>
getAllItemIds()
Get list of ids of all items contained by this DFContainer (seeDFItem.getId()
).java.util.List<E>
getItems()
Get list of all child items.java.util.List<DFNewType<E>>
getNewTypes()
Get the list of all availableDFNewType
.boolean
isDeleteAllowed(E itemToRemove)
Test if the given item is allowed.void
remove(E itemToRemove, boolean destroyArtefacts, com.im.commons.progress.DFEnvironmentRW env)
Removes the child item from the container (clear metadata) and destroy underlying artefacts if requested.void
setItemsOrder(java.util.List<? extends E> items, com.im.commons.progress.DFEnvironmentRW env)
Change the order of child items according to items parameter
-
-
-
Method Detail
-
getNewTypes
java.util.List<DFNewType<E>> getNewTypes()
Get the list of all availableDFNewType
. New types are used for creating new items in this container. If you want to filter the returned new types, use convenience methods inDIFUtilities
-
isDeleteAllowed
boolean isDeleteAllowed(E itemToRemove)
Test if the given item is allowed.
-
remove
void remove(E itemToRemove, boolean destroyArtefacts, com.im.commons.progress.DFEnvironmentRW env)
Removes the child item from the container (clear metadata) and destroy underlying artefacts if requested. Underlying artefacts are usually relational database elements like tables, columns, foreign keys, etc.- Parameters:
itemToRemove
- The item to be removeddestroyArtefacts
- If true, underlying (e.g. database) objects are destroyed. Some DFItems are metadata only (virtual) and do not have any underlying artefacts so then this argument has no meaning in this case (e.g.DFDataTree
has no peer in the database world; the same for the views).
-
getAllItemIds
java.util.List<java.lang.String> getAllItemIds()
Get list of ids of all items contained by this DFContainer (seeDFItem.getId()
).
-
findItemById
E findItemById(java.lang.String id)
Find item by its id (seeDFItem.getId()
).- Parameters:
id
- The ID of the item to find- Returns:
- The item, or null if not present
-
findItemByName
E findItemByName(java.lang.String name)
Find item by its name (seeDFItem.getName()
). If there are multiple items with the same name, one of them will be returned. Ideally, the name should be unique for each item in a DFContainer, but this is not guaranteed by the DB layer.- Parameters:
name
- The name of the item to find- Returns:
- The item, or null if not present
- Since:
- 15.2.2
-
getItems
java.util.List<E> getItems()
Get list of all child items.
-
setItemsOrder
void setItemsOrder(java.util.List<? extends E> items, com.im.commons.progress.DFEnvironmentRW env)
Change the order of child items according to items parameter- Parameters:
items
- items in required orderenv
- environment- Since:
- 6.3
-
-