use of org.apache.cayenne.modeler.undo.CreateQueryUndoableEdit in project cayenne by apache.
the class QueryType method createQuery.
/**
* Action method that creates a query for the specified query type.
*/
public void createQuery() {
String queryType = getSelectedQuery();
// update query...
QueryDescriptor query = QueryDescriptor.descriptor(queryType);
query.setName(NameBuilder.builder(query, dataMap).name());
query.setDataMap(dataMap);
dataMap.addQueryDescriptor(query);
mediator.getApplication().getUndoManager().addEdit(new CreateQueryUndoableEdit(domain, dataMap, query));
// notify listeners
fireQueryEvent(this, mediator, dataMap, query);
view.dispose();
}
Aggregations