Package org.apache.cayenne.map.event

Examples of org.apache.cayenne.map.event.EntityEvent


                String oldQualifier = convertor.valueAsString(entity
                        .getDeclaredQualifier());
                if (!Util.nullSafeEquals(oldQualifier, text)) {
                    Expression exp = (Expression) convertor.stringAsValue(text);
                    entity.setDeclaredQualifier(exp);
                    mediator.fireObjEntityEvent(new EntityEvent(this, entity));
                }
            }
            catch (IllegalArgumentException ex) {
                // unparsable qualifier
                throw new ValidationException(ex.getMessage());
View Full Code Here


        if (newName == null) {
            throw new ValidationException("Entity name is required.");
        }
        else if (entity.getDataMap().getObjEntity(newName) == null) {
            // completely new name, set new name for entity
            EntityEvent e = new EntityEvent(this, entity, entity.getName());
            entity.setName(newName);

            mediator.fireObjEntityEvent(e);

            // suggest to update class name
View Full Code Here

            if (EXCLUDED_TABLES.contains(entity.getName()) && entity.getDataMap() != null) {
                entity.getDataMap().removeDbEntity(entity.getName());
            }
            else if (existingMap) {
                mediator
                        .fireDbEntityEvent(new EntityEvent(this, entity, MapEvent.ADD));
            }
        }
View Full Code Here

            loadStatusNote = "Creating ObjEntity '" + entity.getName() + "'...";
            addedObjEntities.add(entity);

            if (existingMap) {
                mediator.fireObjEntityEvent(new EntityEvent(this, entity, MapEvent.ADD));
            }
        }
View Full Code Here

        public void dbEntityRemoved(DbEntity entity) {
            checkCanceled();

            if (existingMap) {
                mediator.fireDbEntityEvent(new EntityEvent(
                        Application.getFrame(),
                        entity,
                        MapEvent.REMOVE));
            }
        }
View Full Code Here

        public void objEntityRemoved(ObjEntity entity) {
            checkCanceled();

            if (existingMap) {
                mediator.fireObjEntityEvent(new EntityEvent(Application
                        .getFrame(), entity, MapEvent.REMOVE));
            }
        }
View Full Code Here

        }

        model.getEntity().removeAttribute(attribute.getName());
        model.getEntity().addAttribute(attributeSaved);

        mediator.fireObjEntityEvent(new EntityEvent(
                this,
                model.getEntity(),
                MapEvent.CHANGE));

        EntityDisplayEvent event = new EntityDisplayEvent(this, mediator
View Full Code Here

public class EntityEventTest extends TestCase {

    public void testConstructor1() throws Exception {
        Object src = new Object();
        Entity d = new DbEntity("abc");
        EntityEvent e = new EntityEvent(src, d);

        assertSame(src, e.getSource());
        assertSame(d, e.getEntity());
    }
View Full Code Here

    }

    public void testConstructor2() throws Exception {
        Object src = new Object();
        Entity d = new DbEntity("abc");
        EntityEvent e = new EntityEvent(src, d, "oldname");

        assertSame(src, e.getSource());
        assertSame(d, e.getEntity());
        assertEquals("oldname", e.getOldName());
    }
View Full Code Here

    }

    public void testEntity() throws Exception {
        Object src = new Object();
        Entity d = new DbEntity("abc");
        EntityEvent e = new EntityEvent(src, null);

        e.setEntity(d);
        assertSame(d, e.getEntity());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.event.EntityEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.