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 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 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; } } } }
private void getOneToOneBidirectionalProperties(Property property, Map<String, String> attributes) String propertyName = property.getName(); for (Property reverseProperty : getProperties(property.getType()).values()) String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(OneToOne.class) && reversePropertyName.equals(owningProperty) String reversePropertyName = reverseProperty.getName(); String reversePropertyType = reverseProperty.getType(); if (reverseProperty.isAnnotationPresent(OneToOne.class)
private void getManyToManyBidirectionalProperties(Property property, Map<String, String> attributes) String propertyName = property.getName(); for (Property reverseProperty : getProperties(property.getGenericType()).values()) String reversePropertyName = reverseProperty.getName(); String reversePropertyGenericType = reverseProperty.getGenericType(); if (reverseProperty.isAnnotationPresent(ManyToMany.class) && reversePropertyName.equals(owningProperty) String reversePropertyName = reverseProperty.getName(); String reversePropertyGenericType = reverseProperty.getGenericType(); if (reverseProperty.isAnnotationPresent(ManyToMany.class)
private void getManyToManyBidirectionalProperties(Property property, Map<String, String> attributes) String propertyName = property.getName(); for (Property reverseProperty : getProperties(property.getGenericType()).values()) String reversePropertyName = reverseProperty.getName(); String reversePropertyGenericType = reverseProperty.getGenericType(); if (reverseProperty.isAnnotationPresent(ManyToMany.class) && reversePropertyName.equals(owningProperty) String reversePropertyName = reverseProperty.getName(); String reversePropertyGenericType = reverseProperty.getGenericType(); if (reverseProperty.isAnnotationPresent(ManyToMany.class)
element.setAttribute( NAME, property.getName() );