Example usage for org.springframework.data.mapping PropertyHandler doWithPersistentProperty

List of usage examples for org.springframework.data.mapping PropertyHandler doWithPersistentProperty

Introduction

In this page you can find the example usage for org.springframework.data.mapping PropertyHandler doWithPersistentProperty.

Prototype

void doWithPersistentProperty(P persistentProperty);

Source Link

Usage

From source file:com.joyveb.dbpimpl.cass.prepare.convert.MappingCassandraConverter.java

private void doWithAllProperties(final CassandraPersistentEntity<?> entity,
        final PropertyHandler<CassandraPersistentProperty> handler) {

    entity.doWithProperties(new PropertyHandler<CassandraPersistentProperty>() {
        public void doWithPersistentProperty(CassandraPersistentProperty prop) {

            if (prop.hasEmbeddableType()) {

                final CassandraPersistentEntity<?> pkEntity = mappingContext
                        .getPersistentEntity(prop.getRawType());

                if (pkEntity == null) {
                    throw new MappingException("entity not found for " + prop.getRawType());
                }/*from ww w . j  a v a2  s . com*/

                if (prop.isIdProperty()) {
                    validatePkEntity(pkEntity);
                }

                doWithAllProperties(pkEntity, handler);

            } else {

                handler.doWithPersistentProperty(prop);

            }

        }
    });

}

From source file:nivance.jpa.cassandra.prepare.convert.MappingCassandraConverter.java

private void doWithAllProperties(final CassandraPersistentEntity<?> entity,
        final PropertyHandler<CassandraPersistentProperty> handler) {

    entity.doWithProperties(new PropertyHandler<CassandraPersistentProperty>() {
        public void doWithPersistentProperty(CassandraPersistentProperty prop) {
            //TODO 
            if (prop.hasEmbeddableType()) {

                final CassandraPersistentEntity<?> pkEntity = mappingContext
                        .getPersistentEntity(prop.getRawType());

                if (pkEntity == null) {
                    throw new MappingException("entity not found for " + prop.getRawType());
                }//from  w ww. j a  v a 2  s  .c  o  m

                if (prop.isIdProperty()) {
                    validatePkEntity(pkEntity);
                }

                doWithAllProperties(pkEntity, handler);

            } else {

                handler.doWithPersistentProperty(prop);

            }

        }
    });

}