private void getReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getCollectionReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getGenericType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getCollectionReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getGenericType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getCollectionReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getGenericType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getCollectionReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getGenericType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
private void getReversePrimaryKey(Property property, Map<String, String> attributes) { // Reverse primary key for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(Id.class)) { attributes.put(REVERSE_PRIMARY_KEY, reverseProperty.getName()); break; } } }
@Override protected Map<String, String> inspectProperty( Property property ) throws Exception { Map<String, String> attributes = CollectionUtils.newHashMap(); // Hidden if ( property.isAnnotationPresent( XmlTransient.class ) ) { attributes.put( HIDDEN, TRUE ); } // Required XmlElement xmlElement = property.getAnnotation( XmlElement.class ); if ( xmlElement != null ) { // XmlElement overrides XmlTransient attributes.put( HIDDEN, FALSE ); if ( xmlElement.required() ) { attributes.put( REQUIRED, TRUE ); } } return attributes; } }
if ( property.isAnnotationPresent( UiRequired.class ) ) { attributes.put( REQUIRED, TRUE ); if ( property.isAnnotationPresent( UiMasked.class ) ) { attributes.put( MASKED, TRUE ); if ( property.isAnnotationPresent( UiLarge.class ) ) { attributes.put( LARGE, TRUE ); if ( property.isAnnotationPresent( UiWide.class ) ) { attributes.put( WIDE, TRUE );
if ( property.isAnnotationPresent( UiRequired.class ) ) { attributes.put( REQUIRED, TRUE ); if ( property.isAnnotationPresent( UiMasked.class ) ) { attributes.put( MASKED, TRUE ); if ( property.isAnnotationPresent( UiLarge.class ) ) { attributes.put( LARGE, TRUE ); if ( property.isAnnotationPresent( UiWide.class ) ) { attributes.put( WIDE, TRUE );
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getOneToManyBidirectionalProperties(Property property, Map<String, String> attributes) { String owningProperty = property.getAnnotation(OneToMany.class).mappedBy(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a OneToMany * field as the inverse side of the association. */ if (!owningProperty.isEmpty()) { attributes.put(INVERSE_FIELD, property.getName()); for (Property reverseProperty : getProperties(property.getGenericType()).values()) { String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(ManyToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) { attributes.put(OWNING_FIELD, reversePropertyName); break; } } } }
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
private void getManyToOneBidirectionalProperties(Property property, Map<String, String> attributes) { String propertyName = property.getName(); // The ManyToOne side is always the owning side attributes.put(OWNING_FIELD, propertyName); for (Property reverseProperty : getProperties(property.getType()).values()) { if (reverseProperty.isAnnotationPresent(OneToMany.class)) { String mappedPropertyName = reverseProperty.getAnnotation(OneToMany.class).mappedBy(); String reversePropertyType = reverseProperty.getGenericType(); /* * Set the inverse association only when the mappedBy attribute is available. This is as per the JPA * specification. We'll ignore the ability of JPA providers like Hibernate to automatically treat a * OneToMany field as the inverse side of the association. */ if (reversePropertyType.equals(getTypeUnderInspection()) && mappedPropertyName.equals(propertyName)) { attributes.put(INVERSE_FIELD, reverseProperty.getName()); break; } } } }
if (reverseProperty.isAnnotationPresent(OneToOne.class) && reversePropertyName.equals(owningProperty) && reversePropertyType.equals(getTypeUnderInspection())) if (reverseProperty.isAnnotationPresent(OneToOne.class) && !reverseProperty.getAnnotation(OneToOne.class).mappedBy().isEmpty())