Search in sources :

Example 1 with TableFilterAdapter

use of org.hibernate.eclipse.mapper.model.TableFilterAdapter in project jbosstools-hibernate by jbosstools.

the class ObserverAdapterFactory method createAdapter.

protected INodeAdapter createAdapter(INodeNotifier target) {
    Node n = (Node) target;
    String nodeName = n.getNodeName();
    INodeAdapter result = null;
    Object key = DOMAdapter.class;
    if ("hibernate-reverse-engineering".equals(nodeName)) {
        // $NON-NLS-1$
        result = new UnknownNodeAdapter(key, revEngDefinition) {

            public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
                observer.hibernateMappingChanged();
            }
        };
    } else if ("table-filter".equals(nodeName)) {
        // $NON-NLS-1$
        result = new TableFilterAdapter((Node) target, revEngDefinition);
    } else if ("type-mapping".equals(nodeName)) {
        // $NON-NLS-1$
        result = new UnknownNodeAdapter(key, revEngDefinition) {

            public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
                observer.typeMappingChanged(notifier);
            }
        };
    } else if ("sql-type".equals(nodeName)) {
        // $NON-NLS-1$
        result = new TypeMappingAdapter((Node) target, revEngDefinition);
    } else if ("table".equals(nodeName)) {
        // $NON-NLS-1$
        result = new RevEngTableAdapter((Node) target, revEngDefinition);
    } else if ("column".equals(nodeName) || "key-column".equals(nodeName)) {
        // $NON-NLS-1$ //$NON-NLS-2$
        result = new RevEngColumnAdapter((Node) target, revEngDefinition);
    } else if ("primary-key".equals(nodeName)) {
        // $NON-NLS-1$
        result = new RevEngPrimaryKeyAdapter((Node) target, revEngDefinition);
    } else if ("generator".equals(nodeName)) {
        // $NON-NLS-1$
        result = new RevEngGeneratorAdapter((Node) target, revEngDefinition);
    } else if ("param".equals(nodeName)) {
        // $NON-NLS-1$
        result = new RevEngParamAdapter((Node) target, revEngDefinition);
    } else if (// $NON-NLS-1$
    "foreign-key".equals(nodeName) || // $NON-NLS-1$
    "column-ref".equals(nodeName)) {
        result = new UnknownNodeAdapter(key, revEngDefinition) {

            public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
                observer.tablesChanged(notifier);
            }
        };
    }
    if (result == null) {
        result = new UnknownNodeAdapter(key, revEngDefinition);
    }
    if (result != null) {
        adaptChildren((Node) target);
    }
    return result;
}
Also used : INodeAdapter(org.eclipse.wst.sse.core.internal.provisional.INodeAdapter) RevEngPrimaryKeyAdapter(org.hibernate.eclipse.mapper.model.RevEngPrimaryKeyAdapter) Node(org.w3c.dom.Node) TableFilterAdapter(org.hibernate.eclipse.mapper.model.TableFilterAdapter) TypeMappingAdapter(org.hibernate.eclipse.mapper.model.TypeMappingAdapter) RevEngParamAdapter(org.hibernate.eclipse.mapper.model.RevEngParamAdapter) DOMAdapter(org.hibernate.eclipse.mapper.model.DOMAdapter) RevEngTableAdapter(org.hibernate.eclipse.mapper.model.RevEngTableAdapter) RevEngColumnAdapter(org.hibernate.eclipse.mapper.model.RevEngColumnAdapter) RevEngGeneratorAdapter(org.hibernate.eclipse.mapper.model.RevEngGeneratorAdapter) INodeNotifier(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)

Aggregations

INodeAdapter (org.eclipse.wst.sse.core.internal.provisional.INodeAdapter)1 INodeNotifier (org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)1 DOMAdapter (org.hibernate.eclipse.mapper.model.DOMAdapter)1 RevEngColumnAdapter (org.hibernate.eclipse.mapper.model.RevEngColumnAdapter)1 RevEngGeneratorAdapter (org.hibernate.eclipse.mapper.model.RevEngGeneratorAdapter)1 RevEngParamAdapter (org.hibernate.eclipse.mapper.model.RevEngParamAdapter)1 RevEngPrimaryKeyAdapter (org.hibernate.eclipse.mapper.model.RevEngPrimaryKeyAdapter)1 RevEngTableAdapter (org.hibernate.eclipse.mapper.model.RevEngTableAdapter)1 TableFilterAdapter (org.hibernate.eclipse.mapper.model.TableFilterAdapter)1 TypeMappingAdapter (org.hibernate.eclipse.mapper.model.TypeMappingAdapter)1 Node (org.w3c.dom.Node)1