title: Flutter floor You are trying to change an object which is not an entity
body: <p>I have 2 Entities in my Flutter project. User and Team. I add User as an Entity and generate the autogenerated code successfully.</p>
  <p>After this, i add the Team Entity, with the same way and got the error:</p>
  <blockquote>
  <p>You are trying to change an object which is not an entity</p>
  </blockquote>
  <p>for my insert method.</p>
  <p>My User Entity:</p>
  <pre><code>@entity
  class User {
  
    @PrimaryKey(autoGenerate: true)
    int? id;
  
    String firstName = &quot;&quot;;
  
    User({
      this.id,
      required this.firstName,
    });
  
    Map&lt;String, dynamic&gt; toJson() {
      return {
        'id': id,
        'firstName': firstName,
      };
    }
  }
  </code></pre>
  <p>My user_dao:</p>
  <pre><code>@dao
  abstract class UserDao {
    @Query('SELECT * FROM user')
    Future&lt;List&lt;User&gt;&gt; findAllUsers();
  
    @Query('SELECT * FROM user WHERE id = :id')
    Future&lt;User?&gt; findUserById(int id);
  
    @insert
    Future&lt;void&gt; insertUser(User user);
  
    @update
    Future&lt;void&gt; updateUser(User user);
  
    @delete
    Future&lt;void&gt; deleteUser(User user);
  }
  </code></pre>
  <p>And my database:</p>
  <pre><code>@Database(version: 1, entities: [User])
  abstract class AppDatabase extends FloorDatabase {
    UserDao get userDao;
  }
  </code></pre>
  <p>This is working pretty fine.</p>
  <p>Now i add my Team Entity:</p>
  <pre><code>@entity
  class Team {
  
    @PrimaryKey(autoGenerate: true)
    int? id;
  
    String name = &quot;&quot;;
  
    Team({
      this.id,
      required this.name
    });
  
    Map&lt;String, dynamic&gt; toJson() {
      return {
        'id': id,
        'name': name,
      };
    }
  }
  </code></pre>
  <p>And my team_dao as well:</p>
  <pre><code>@dao
  abstract class TeamDao {
    @Query('SELECT * FROM team')
    Future&lt;List&lt;Team&gt;&gt; findAllTeams();
  
    @Query('SELECT * FROM team WHERE id = :id')
    Future&lt;Team?&gt; findTeamById(int id);
  
    @insert
    Future&lt;void&gt; insertTeam(Team team);
  
    @update
    Future&lt;void&gt; updateTeam(Team team);
  
    @delete
    Future&lt;void&gt; deleteTeam(Team team);
  }
  </code></pre>
  <p>After all, i add the new dao to the database:</p>
  <pre><code>@Database(version: 1, entities: [User])
  @Database(version: 2, entities: [Team])
  abstract class AppDatabase extends FloorDatabase {
    UserDao get userDao;
    TeamDao get teamDao;
  }
  </code></pre>
  <p>But now, i got the error message for my team_doa</p>
  <blockquote>
  <p>You are trying to change an object which is not an entity</p>
  </blockquote>
  <pre><code>Future&lt;void&gt; insertTeam(Team team);
  </code></pre>
  <p>But i don't understand why? Or did i some mistake?</p>