Code example for Collection

Methods: getElement

0
        referencingEntityConfiguration = mainGenerator.getEntitiesConfigurations().get(referencingEntityName);
        if (referencingEntityConfiguration == null) {
            throw new MappingException("Unable to read auditing configuration for " + referencingEntityName + "!");
        } 
 
        referencedEntityName = MappingTools.getReferencedEntityName(propertyValue.getElement());
    } 
 
    void addCollection() { 
        Type type = propertyValue.getType();
 
        boolean oneToManyAttachedType = type instanceof BagType || type instanceof SetType || type instanceof MapType || type instanceof ListType;
        boolean inverseOneToMany = (propertyValue.getElement() instanceof OneToMany) && (propertyValue.isInverse());
        boolean fakeOneToManyBidirectional = (propertyValue.getElement() instanceof OneToMany) && (propertyAuditingData.getAuditMappedBy() != null);
 
        if (oneToManyAttachedType && (inverseOneToMany || fakeOneToManyBidirectional)) {
            // A one-to-many relation mapped using @ManyToOne and @OneToMany(mappedBy="...") 
            addOneToManyAttached(fakeOneToManyBidirectional);
        } else { 
            // All other kinds of relations require a middle (join) table. 
Experience pair programming with AI  Get Codota for Java