use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class CreateAttributeAction method createEmbAttribute.
public void createEmbAttribute(Embeddable embeddable, EmbeddableAttribute attr) {
ProjectController mediator = getProjectController();
embeddable.addAttribute(attr);
fireEmbeddableAttributeEvent(this, mediator, embeddable, attr);
}
use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class CreateDataMapAction method createDataMap.
/**
* Calls addDataMap() or creates new data map if no data node selected.
*/
public void createDataMap(DataMap map) {
ProjectController mediator = getProjectController();
mediator.addDataMap(this, map);
}
use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class CreateDbEntityAction method performAction.
/**
* Creates new DbEntity, adds it to the current DataMap, fires DbEntityEvent and DbEntityDisplayEvent.
*/
public void performAction(ActionEvent e) {
ProjectController mediator = getProjectController();
DataMap map = mediator.getCurrentDataMap();
DbEntity entity = new DbEntity();
entity.setName(NameBuilder.builder(entity, map).name());
createEntity(map, entity);
application.getUndoManager().addEdit(new CreateDbEntityUndoableEdit(map, entity));
}
use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class CreateDbEntityAction method createEntity.
/**
* Constructs and returns a new DbEntity. Entity returned is added to the
* DataMap.
*/
public void createEntity(DataMap map, DbEntity entity) {
ProjectController mediator = getProjectController();
entity.setCatalog(map.getDefaultCatalog());
entity.setSchema(map.getDefaultSchema());
map.addDbEntity(entity);
fireDbEntityEvent(this, mediator, entity);
}
use of org.apache.cayenne.modeler.ProjectController in project cayenne by apache.
the class CreateNodeAction method buildDataNode.
/**
* Creates a new DataNode, adding to the current domain, but doesn't send
* any events.
*/
public DataNodeDescriptor buildDataNode() {
ProjectController mediator = getProjectController();
DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
DataNodeDescriptor node = buildDataNode(domain);
DataSourceInfo src = new DataSourceInfo();
node.setDataSourceDescriptor(src);
// by default create JDBC Node
node.setDataSourceFactoryType(XMLPoolingDataSourceFactory.class.getName());
node.setSchemaUpdateStrategyType(SkipSchemaUpdateStrategy.class.getName());
return node;
}
Aggregations