public ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta, PropertyMeta propertyMeta) { if (!propertyMeta.isRelationship() || propertyMeta.getMappedBy() != null) { return null; } ReferentialConstraint referentialConstraint = propertyMeta.getField().getAnnotation(ReferentialConstraint.class); if (referentialConstraint == null) { if (!regardRelationshipAsFk) { return null; } } else { if (!referentialConstraint.enable()) { return null; } } ForeignKeyDesc foreignKeyDesc = new ForeignKeyDesc(); doColumn(entityMeta, propertyMeta, foreignKeyDesc); doTable(entityMeta, propertyMeta, foreignKeyDesc); doReferetialAction(entityMeta, propertyMeta, foreignKeyDesc); return foreignKeyDesc; }