private PropertyAccess buildPropertyAccess(Property mappedProperty) { if ( mappedProperty.isBackRef() ) { return mappedProperty.getPropertyAccessStrategy( null ).buildPropertyAccess( null, mappedProperty.getName() ); } else { return PropertyAccessStrategyMapImpl.INSTANCE.buildPropertyAccess( null, mappedProperty.getName() ); } }
public Property next() { if ( backLog != null ) { Property p = backLog; backLog = null; return p; } Property nextProperty = (Property) delegate.next(); while ( nextProperty.isBackRef() && delegate.hasNext() ) { nextProperty = (Property) delegate.next(); } if ( nextProperty.isBackRef() ) { throw new NoSuchElementException(); } return nextProperty; }
public boolean hasNext() { if ( backLog!=null ) { return true; } else if ( delegate.hasNext() ) { Property nextProperty = (Property) delegate.next(); while ( nextProperty.isBackRef() && delegate.hasNext() ) { nextProperty = (Property) delegate.next(); } if ( !nextProperty.isBackRef() ) { backLog = nextProperty; return true; } } return false; }
public Property next() { if ( backLog != null ) { Property p = backLog; backLog = null; return p; } Property nextProperty = (Property) delegate.next(); while ( nextProperty.isBackRef() && delegate.hasNext() ) { nextProperty = (Property) delegate.next(); } if ( nextProperty.isBackRef() ) { throw new NoSuchElementException(); } return nextProperty; }
public boolean hasNext() { if ( backLog!=null ) { return true; } else if ( delegate.hasNext() ) { Property nextProperty = (Property) delegate.next(); while ( nextProperty.isBackRef() && delegate.hasNext() ) { nextProperty = (Property) delegate.next(); } if ( !nextProperty.isBackRef() ) { backLog = nextProperty; return true; } } return false; }
private PropertyAccessor buildPropertyAccessor(Property mappedProperty) { if ( mappedProperty.isBackRef() ) { return mappedProperty.getPropertyAccessor(null); } else { return PropertyAccessorFactory.getDynamicMapPropertyAccessor(); } }
private PropertyAccessor buildPropertyAccessor(Property mappedProperty) { if ( mappedProperty.isBackRef() ) { return mappedProperty.getPropertyAccessor(null); } else { return PropertyAccessorFactory.getDynamicMapPropertyAccessor(); } }
private PropertyAccessor buildPropertyAccessor(Property mappedProperty) { if ( mappedProperty.isBackRef() ) { return mappedProperty.getPropertyAccessor(null); } else { return PropertyAccessorFactory.getDynamicMapPropertyAccessor(); } }
protected List<Property> getPropertiesForFullConstructor(PersistentClass pc) { List<Property> result = new ArrayList<Property>(); for ( Iterator<Property> myFields = getAllPropertiesIterator(pc); myFields.hasNext() ; ) { Property field = (Property) myFields.next(); // TODO: if(!field.isGenerated() ) ) { if(field.equals(pc.getIdentifierProperty()) && !isAssignedIdentifier(pc, field)) { continue; // dont add non assigned identifiers } else if(field.equals(pc.getVersion())) { continue; // version prop } else if(field.isBackRef()) { continue; } else if(isFormula(field)) { continue; } else { result.add( field ); } } return result; }
protected List<Property> getPropertiesForFullConstructor(PersistentClass pc) { List<Property> result = new ArrayList<Property>(); for ( Iterator<Property> myFields = getAllPropertiesIterator(pc); myFields.hasNext() ; ) { Property field = (Property) myFields.next(); // TODO: if(!field.isGenerated() ) ) { if(field.equals(pc.getIdentifierProperty()) && !isAssignedIdentifier(pc, field)) { continue; // dont add non assigned identifiers } else if(field.equals(pc.getVersion())) { continue; // version prop } else if(field.isBackRef()) { continue; } else if(isFormula(field)) { continue; } else { result.add( field ); } } return result; }
@SuppressWarnings("unchecked") private void addSubElement(Property property, ValidatableElement element) { if ( property != null && property.isComposite() && ! property.isBackRef() ) { Component component = (Component) property.getValue(); if ( component.isEmbedded() ) return; PropertyAccessor accessor = PropertyAccessorFactory.getPropertyAccessor( property, EntityMode.POJO ); Getter getter = accessor.getGetter( element.clazz, property.getName() ); ClassValidator validator = new ClassValidator( getter.getReturnType() ); ValidatableElement subElement = new ValidatableElement( getter.getReturnType(), validator, getter ); Iterator properties = component.getPropertyIterator(); while ( properties.hasNext() ) { addSubElement( (Property) properties.next(), subElement ); } if ( subElement.getSubElements().size() != 0 || subElement.validator.hasValidationRules() ) { element.addSubElement( subElement ); } } }
private PropertyAccessor buildPropertyAccessor(Property mappedProperty) { if ( mappedProperty.isBackRef() ) { return mappedProperty.getPropertyAccessor(null); } else { return PropertyAccessorFactory.getDom4jPropertyAccessor( mappedProperty.getNodeName(), mappedProperty.getType(), getEntityMetamodel().getSessionFactory() ); } }
@SuppressWarnings( "unchecked" ) private void addSubElement(Property property, ValidatableElement element) { if ( property != null && property.isComposite() && !property.isBackRef() ) { Component component = (Component) property.getValue(); if ( component.isEmbedded() ) return; PropertyAccessor accessor = PropertyAccessorFactory.getPropertyAccessor( property, EntityMode.POJO ); Getter getter = accessor.getGetter( element.clazz, property.getName() ); ClassValidator validator = new ClassValidator( getter.getReturnType() ); ValidatableElement subElement = new ValidatableElement( getter.getReturnType(), validator, getter ); Iterator properties = component.getPropertyIterator(); while ( properties.hasNext() ) { addSubElement( (Property) properties.next(), subElement ); } if ( subElement.getSubElements().size() != 0 || subElement.validator.hasValidationRules() ) { element.addSubElement( subElement ); } } }
private void handleProperty(EntityType entityType, Class<?> cl, org.hibernate.mapping.Property p) throws NoSuchMethodException, ClassNotFoundException { if (p.isBackRef()) { return;
private void handleProperty(EntityType entityType, Class<?> cl, org.hibernate.mapping.Property p) throws NoSuchMethodException, ClassNotFoundException { if (p.isBackRef()) { return;