package com.github.dkharrat.nexusdata.modelgen.metamodel;

import org.modeshape.common.text.Inflector;

public class Relationship extends Property {
    String destinationEntity;
    String inverseName;
    boolean toMany = false;

    public String getJavaType() {
        if (toMany) {
            return "Set<" + destinationEntity + ">";
        } else {
            return destinationEntity;
        }
    }

    public boolean isToMany() {
        return toMany;
    }

    public String getDestinationEntity() {
        return destinationEntity;
    }

    public String getMethodNameForAddingToCollection() {
        return "add" + capitalizedFirstChar(getSingularName());
    }
}

@@ -56,53 +56,8 @@
 l;%0A%0A
-import org.modeshape.common.text.Inflector;%0A%0A
 publ
@@ -131,32 +131,8 @@
 ty;%0A
-    String inverseName;%0A
     

remove unused var