@@ -28,7 +28,7 @@ public final class Blog7V2 implements Model {
2828 public static final QueryField NAME = field (\\" Blog7V2\\ " , \\" name\\ " );
2929 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
3030 private final @ModelField (targetType = \\" String\\ " , isRequired = true ) String name ;
31- private final @ModelField (targetType = \\" Post7V2\\ " ) @HasMany (associatedWith = \\" blog \\ " , type = Post7V2 .class ) List <Post7V2 > posts = null;
31+ private final @ModelField (targetType = \\" Post7V2\\ " ) @HasMany (associatedWith = \\" blog7V2PostsId \\ " , type = Post7V2 .class ) List <Post7V2 > posts = null;
3232 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime createdAt;
3333 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime updatedAt;
3434 public String getId() {
@@ -205,7 +205,7 @@ public final class Post7V2 implements Model {
205205 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
206206 private final @ModelField (targetType = \\" String\\ " , isRequired = true ) String title ;
207207 private final @ModelField (targetType = \\" Blog7V2\\ " ) @BelongsTo (targetName = \\" blog7V2PostsId\\ " , type = Blog7V2 .class ) Blog7V2 blog ;
208- private final @ModelField (targetType = \\" Comment7V2\\ " ) @HasMany (associatedWith = \\" post \\ " , type = Comment7V2 .class ) List <Comment7V2 > comments = null;
208+ private final @ModelField (targetType = \\" Comment7V2\\ " ) @HasMany (associatedWith = \\" post7V2CommentsId \\ " , type = Comment7V2 .class ) List <Comment7V2 > comments = null;
209209 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime createdAt;
210210 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime updatedAt;
211211 public String getId() {
@@ -616,7 +616,7 @@ public final class Project implements Model {
616616 public static final QueryField PROJECT_TEAM_ID = field (\\" Project\\ " , \\" projectTeamId\\ " );
617617 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
618618 private final @ModelField (targetType = \\" String\\ " ) String name ;
619- private final @ModelField (targetType = \\" Team\\ " ) @HasOne (associatedWith = \\" project \\ " , type = Team .class ) Team team = null ;
619+ private final @ModelField (targetType = \\" Team\\ " ) @HasOne (associatedWith = \\" id \\ " , type = Team .class ) Team team = null ;
620620 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime createdAt ;
621621 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime updatedAt ;
622622 private final @ModelField (targetType = \\" ID\\ " ) String projectTeamId ;
@@ -1008,7 +1008,7 @@ public final class Project2 implements Model {
10081008 public static final QueryField PROJECT2_TEAM_ID = field (\\" Project2\\ " , \\" project2TeamId\\ " );
10091009 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
10101010 private final @ModelField (targetType = \\" String\\ " ) String name ;
1011- private final @ModelField (targetType = \\" Team2\\ " ) @HasOne (associatedWith = \\" project \\ " , type = Team2 .class ) Team2 team = null ;
1011+ private final @ModelField (targetType = \\" Team2\\ " ) @HasOne (associatedWith = \\" id \\ " , type = Team2 .class ) Team2 team = null ;
10121012 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime createdAt ;
10131013 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime updatedAt ;
10141014 private final @ModelField (targetType = \\" ID\\ " ) String project2TeamId ;
@@ -1770,7 +1770,7 @@ public final class Post implements Model {
17701770 public static final QueryField TITLE = field (\\" Post\\ " , \\" title\\ " );
17711771 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
17721772 private final @ModelField (targetType = \\" String\\ " , isRequired = true ) String title ;
1773- private final @ModelField (targetType = \\" Comment\\ " ) @HasMany (associatedWith = \\" id \\ " , type = Comment .class ) List <Comment > comments = null;
1773+ private final @ModelField (targetType = \\" Comment\\ " ) @HasMany (associatedWith = \\" postCommentsId \\ " , type = Comment .class ) List <Comment > comments = null;
17741774 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime createdAt;
17751775 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime updatedAt;
17761776 public String getId() {
@@ -1941,10 +1941,12 @@ import static com.amplifyframework.core.model.query.predicate.QueryField.field;
19411941public final class Comment implements Model {
19421942 public static final QueryField ID = field (\\" Comment\\ " , \\" id\\ " );
19431943 public static final QueryField CONTENT = field (\\" Comment\\ " , \\" content\\ " );
1944+ public static final QueryField POST_COMMENTS_ID = field (\\" Comment\\ " , \\" postCommentsId\\ " );
19441945 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
19451946 private final @ModelField (targetType = \\" String\\ " , isRequired = true ) String content ;
19461947 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime createdAt ;
19471948 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime updatedAt ;
1949+ private final @ModelField (targetType = \\" ID\\ " ) String postCommentsId ;
19481950 public String getId () {
19491951 return id;
19501952 }
@@ -1961,9 +1963,14 @@ public final class Comment implements Model {
19611963 return updatedAt;
19621964 }
19631965
1964- private Comment (String id , String content ) {
1966+ public String getPostCommentsId () {
1967+ return postCommentsId;
1968+ }
1969+
1970+ private Comment (String id , String content , String postCommentsId ) {
19651971 this.id = id;
19661972 this.content = content;
1973+ this.postCommentsId = postCommentsId;
19671974 }
19681975
19691976 @Override
@@ -1977,7 +1984,8 @@ public final class Comment implements Model {
19771984 return ObjectsCompat.equals(getId (), comment.getId()) &&
19781985 ObjectsCompat.equals(getContent (), comment.getContent()) &&
19791986 ObjectsCompat.equals(getCreatedAt (), comment.getCreatedAt()) &&
1980- ObjectsCompat.equals(getUpdatedAt (), comment.getUpdatedAt());
1987+ ObjectsCompat.equals(getUpdatedAt (), comment.getUpdatedAt()) &&
1988+ ObjectsCompat.equals(getPostCommentsId (), comment.getPostCommentsId());
19811989 }
19821990 }
19831991
@@ -1988,6 +1996,7 @@ public final class Comment implements Model {
19881996 .append (getContent ())
19891997 .append (getCreatedAt ())
19901998 .append (getUpdatedAt ())
1999+ .append (getPostCommentsId ())
19912000 .toString ()
19922001 .hashCode ();
19932002 }
@@ -1999,7 +2008,8 @@ public final class Comment implements Model {
19992008 .append (\\" id=\\ " + String .valueOf (getId ()) + \\" , \\ " )
20002009 .append (\\" content=\\ " + String .valueOf (getContent ()) + \\" , \\ " )
20012010 .append (\\" createdAt=\\ " + String .valueOf (getCreatedAt ()) + \\" , \\ " )
2002- .append (\\" updatedAt=\\ " + String .valueOf (getUpdatedAt ()))
2011+ .append (\\" updatedAt=\\ " + String .valueOf (getUpdatedAt ()) + \\" , \\ " )
2012+ .append (\\" postCommentsId=\\ " + String .valueOf (getPostCommentsId ()))
20032013 .append (\\" }\\ " )
20042014 .toString ();
20052015 }
@@ -2019,13 +2029,15 @@ public final class Comment implements Model {
20192029 public static Comment justId(String id) {
20202030 return new Comment (
20212031 id ,
2032+ null ,
20222033 null
20232034 );
20242035 }
20252036
20262037 public CopyOfBuilder copyOfBuilder() {
20272038 return new CopyOfBuilder (id ,
2028- content );
2039+ content ,
2040+ postCommentsId );
20292041 }
20302042 public interface ContentStep {
20312043 BuildStep content (String content );
@@ -2035,19 +2047,22 @@ public final class Comment implements Model {
20352047 public interface BuildStep {
20362048 Comment build ();
20372049 BuildStep id (String id );
2050+ BuildStep postCommentsId (String postCommentsId );
20382051 }
20392052
20402053
20412054 public static class Builder implements ContentStep, BuildStep {
20422055 private String id ;
20432056 private String content ;
2057+ private String postCommentsId ;
20442058 @Override
20452059 public Comment build () {
20462060 String id = this.id != null ? this.id : UUID .randomUUID ().toString ();
20472061
20482062 return new Comment (
20492063 id ,
2050- content );
2064+ content ,
2065+ postCommentsId );
20512066 }
20522067
20532068 @Override
@@ -2057,6 +2072,12 @@ public final class Comment implements Model {
20572072 return this;
20582073 }
20592074
2075+ @Override
2076+ public BuildStep postCommentsId (String postCommentsId ) {
2077+ this.postCommentsId = postCommentsId;
2078+ return this;
2079+ }
2080+
20602081 /**
20612082 * @param id id
20622083 * @return Current Builder instance, for fluent method chaining
@@ -2069,15 +2090,21 @@ public final class Comment implements Model {
20692090
20702091
20712092 public final class CopyOfBuilder extends Builder {
2072- private CopyOfBuilder (String id , String content ) {
2093+ private CopyOfBuilder (String id , String content , String postCommentsId ) {
20732094 super.id(id );
2074- super.content(content );
2095+ super.content(content )
2096+ .postCommentsId(postCommentsId );
20752097 }
20762098
20772099 @Override
20782100 public CopyOfBuilder content (String content ) {
20792101 return (CopyOfBuilder ) super.content(content );
20802102 }
2103+
2104+ @Override
2105+ public CopyOfBuilder postCommentsId (String postCommentsId ) {
2106+ return (CopyOfBuilder ) super.postCommentsId(postCommentsId );
2107+ }
20812108 }
20822109
20832110}
@@ -4210,7 +4237,7 @@ public final class Project implements Model {
42104237 public static final QueryField PROJECT_TEAM_ID = field (\\" Project\\ " , \\" projectTeamId\\ " );
42114238 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
42124239 private final @ModelField (targetType = \\" String\\ " ) String name ;
4213- private final @ModelField (targetType = \\" Team\\ " ) @HasOne (associatedWith = \\" project \\ " , type = Team .class ) Team team = null ;
4240+ private final @ModelField (targetType = \\" Team\\ " ) @HasOne (associatedWith = \\" id \\ " , type = Team .class ) Team team = null ;
42144241 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime createdAt ;
42154242 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime updatedAt ;
42164243 private final @ModelField (targetType = \\" ID\\ " ) String projectTeamId ;
@@ -4602,7 +4629,7 @@ public final class Project implements Model {
46024629 public static final QueryField PROJECT_TEAM_ID = field (\\" Project\\ " , \\" projectTeamId\\ " );
46034630 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
46044631 private final @ModelField (targetType = \\" String\\ " ) String name ;
4605- private final @ModelField (targetType = \\" Team\\ " ) @HasOne (associatedWith = \\" project \\ " , type = Team .class ) Team team = null ;
4632+ private final @ModelField (targetType = \\" Team\\ " ) @HasOne (associatedWith = \\" id \\ " , type = Team .class ) Team team = null ;
46064633 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime createdAt ;
46074634 private @ModelField (targetType = \\" AWSDateTime\\ " , isReadOnly = true ) Temporal .DateTime updatedAt ;
46084635 private final @ModelField (targetType = \\" ID\\ " ) String projectTeamId ;
@@ -4993,7 +5020,7 @@ public final class CookingBlog implements Model {
49935020 public static final QueryField NAME = field (\\" CookingBlog\\ " , \\" name\\ " );
49945021 private final @ModelField (targetType = \\" ID\\ " , isRequired = true ) String id ;
49955022 private final @ModelField (targetType = \\" String\\ " , isRequired = true ) String name ;
4996- private final @ModelField (targetType = \\" RecipePost\\ " ) @HasMany (associatedWith = \\" blog \\ " , type = RecipePost .class ) List <RecipePost > posts = null;
5023+ private final @ModelField (targetType = \\" RecipePost\\ " ) @HasMany (associatedWith = \\" cookingBlogPostsId \\ " , type = RecipePost .class ) List <RecipePost > posts = null;
49975024 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime createdAt;
49985025 private @ModelField(targetType=\\"AWSDateTime\\", isReadOnly = true) Temporal.DateTime updatedAt;
49995026 public String getId() {
0 commit comments