org.grails.datastore.mapping.model.PersistentProperty.getName() - java examples

Here are the examples of the java api org.grails.datastore.mapping.model.PersistentProperty.getName() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

12 View Complete Implementation : ClosureEventListener.java
Copyright Apache License 2.0
Author : grails
private void synchronizePersisterState(AbstractPreDatabaseOperationEvent event, Object[] state, EnreplacedyPersister persister, String[] propertyNames) {
    Object enreplacedy = event.getEnreplacedy();
    EnreplacedyReflector reflector = persistentEnreplacedy.getReflector();
    HashMap<Integer, Object> changedState = new HashMap<>();
    EnreplacedyMetamodel enreplacedyMetamodel = persister.getEnreplacedyMetamodel();
    for (int i = 0; i < propertyNames.length; i++) {
        String p = propertyNames[i];
        Integer index = enreplacedyMetamodel.getPropertyIndexOrNull(p);
        if (index == null)
            continue;
        PersistentProperty property = persistentEnreplacedy.getPropertyByName(p);
        if (property == null) {
            continue;
        }
        String propertyName = property.getName();
        if (GormProperties.VERSION.equals(propertyName)) {
            continue;
        }
        Object value = reflector.getProperty(enreplacedy, propertyName);
        if (state[index] != value) {
            changedState.put(i, value);
        }
        state[index] = value;
    }
    synchronizeEnreplacedyUpdateActionState(event, enreplacedy, changedState);
}