diff --git a/elide-model-config/src/main/resources/templates/table.hbs b/elide-model-config/src/main/resources/templates/table.hbs index e0d66ff90e..559d7d1229 100644 --- a/elide-model-config/src/main/resources/templates/table.hbs +++ b/elide-model-config/src/main/resources/templates/table.hbs @@ -123,7 +123,7 @@ public class <%#capitalizeFirstLetter name%><%/capitalizeFirstLetter%>{ <%else%> private <%joinClassName%> <%name%>; - @Join(value="<%#trimColumnReferences definition%><%/trimColumnReferences%>"<%#if type%>, type=JoinType.<%#toUpperCase type%><%/toUpperCase%><%/if%>) + @Join(value="<%#if definition%><%#trimColumnReferences definition%><%/trimColumnReferences%><%/if%>"<%#if type%>, type=JoinType.<%#toUpperCase type%><%/toUpperCase%><%/if%>) public <%joinClassName%> get<%#capitalizeFirstLetter name%> <%/capitalizeFirstLetter%>() { return <%name%>; } diff --git a/elide-model-config/src/test/java/com/yahoo/elide/modelconfig/parser/handlebars/HandlebarsHydratorTest.java b/elide-model-config/src/test/java/com/yahoo/elide/modelconfig/parser/handlebars/HandlebarsHydratorTest.java index bd28eb0581..9accb7ae04 100644 --- a/elide-model-config/src/test/java/com/yahoo/elide/modelconfig/parser/handlebars/HandlebarsHydratorTest.java +++ b/elide-model-config/src/test/java/com/yahoo/elide/modelconfig/parser/handlebars/HandlebarsHydratorTest.java @@ -52,13 +52,13 @@ public class HandlebarsHydratorTest { + " {\n" + " name: playerCountry\n" + " to: Country\n" - + " type: fuLL\n" - + " definition: '{{ playerCountry.id}} = {{country_id}}'\n" + + " type: Cross\n" + " },\n" + " {\n" + " name: playerTeam\n" + " to: Team\n" + " kind: Tomany\n" + + " type: left\n" + " definition: '{{playerTeam.id}} = {{ team_id}}'\n" + " }\n" + " ]\n" @@ -306,7 +306,7 @@ public class HandlebarsHydratorTest { + "\n" + " private Country playerCountry;\n" + "\n" - + " @Join(value=\"{{playerCountry.id}} = {{country_id}}\", type=JoinType.FULL)\n" + + " @Join(value=\"\", type=JoinType.CROSS)\n" + " public Country getPlayerCountry() {\n" + " return playerCountry;\n" + " }\n" @@ -320,7 +320,7 @@ public class HandlebarsHydratorTest { + "\n" + " private Set playerTeam;\n" + "\n" - + " @Join(value=\"{{playerTeam.id}} = {{team_id}}\")\n" + + " @Join(value=\"{{playerTeam.id}} = {{team_id}}\", type=JoinType.LEFT)\n" + " public Set getPlayerTeam() {\n" + " return playerTeam;\n" + " }\n" diff --git a/elide-model-config/src/test/resources/validator/valid/models/tables/player_stats.hjson b/elide-model-config/src/test/resources/validator/valid/models/tables/player_stats.hjson index abc7369065..d75aebee1d 100644 --- a/elide-model-config/src/test/resources/validator/valid/models/tables/player_stats.hjson +++ b/elide-model-config/src/test/resources/validator/valid/models/tables/player_stats.hjson @@ -24,13 +24,13 @@ { name: playerCountry to: Country - type: fuLL - definition: '{{ playerCountry.id}} = {{country_id}}' + type: Cross }, { name: playerTeam to: Team kind: Tomany + type: left definition: '{{playerTeam.id}} = {{ team_id}}' } ]