use of org.apache.cayenne.map.Embeddable in project cayenne by apache.
the class CayenneGeneratorEntityFilterAction method getFilteredEmbeddables.
Collection<Embeddable> getFilteredEmbeddables(DataMap mainDataMap) {
Collection<Embeddable> embeddables = new ArrayList<>(mainDataMap.getEmbeddables());
// filter out excluded entities...
Iterator<Embeddable> it = embeddables.iterator();
while (it.hasNext()) {
Embeddable e = it.next();
// have a symbolic name...
if (!nameFilter.isIncluded(e.getClassName())) {
it.remove();
}
}
return embeddables;
}
use of org.apache.cayenne.map.Embeddable in project cayenne by apache.
the class EmbeddableTab method setComment.
void setComment(String comment) {
Embeddable embeddable = mediator.getCurrentEmbeddable();
if (embeddable == null) {
return;
}
ObjectInfo.putToMetaData(mediator.getApplication().getMetaData(), embeddable, ObjectInfo.COMMENT, comment);
mediator.fireEmbeddableEvent(new EmbeddableEvent(this, embeddable), mediator.getCurrentDataMap());
}
use of org.apache.cayenne.map.Embeddable in project cayenne by apache.
the class ProjectController method getEmbeddableNamesInCurrentDataDomain.
public Set<String> getEmbeddableNamesInCurrentDataDomain() {
ArrayList<Embeddable> embs = getEmbeddablesInCurrentDataDomain();
Set<String> embNames = new HashSet<>(embs.size());
for (Embeddable emb : embs) {
embNames.add(emb.getClassName());
}
return embNames;
}
use of org.apache.cayenne.map.Embeddable in project cayenne by apache.
the class ProjectController method getEmbeddablesInCurrentDataDomain.
public ArrayList<Embeddable> getEmbeddablesInCurrentDataDomain() {
DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor) getProject().getRootNode();
Collection<DataMap> maps = dataChannelDescriptor.getDataMaps();
Iterator<DataMap> it = maps.iterator();
ArrayList<Embeddable> embs = new ArrayList<>();
while (it.hasNext()) {
embs.addAll(it.next().getEmbeddables());
}
return embs;
}
use of org.apache.cayenne.map.Embeddable in project cayenne by apache.
the class ProjectTreeView method embeddableAdded.
public void embeddableAdded(EmbeddableEvent e, DataMap map) {
Embeddable embeddable = e.getEmbeddable();
DefaultMutableTreeNode mapNode = getProjectModel().getNodeForObjectPath(new Object[] { e.getDomain() != null ? e.getDomain() : (DataChannelDescriptor) mediator.getProject().getRootNode(), map });
if (mapNode == null) {
return;
}
DefaultMutableTreeNode currentNode = new DefaultMutableTreeNode(embeddable, false);
positionNode(mapNode, currentNode, Comparators.getDataMapChildrenComparator());
showNode(currentNode);
}
Aggregations