hardcode _id as collection primary key field name

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Another MongoDB dialect's idiosyncrasy: `_id` must be the primary key field name.

      So for the following example Entity class:

      @Entity
      class Book {
          @Id
          int id;
      }

       

      The `id` entity field should be mapped and persisted in `_id` primary key field name in MongoDB.

       

      But if primary key column name has been specified as below example:

      @Entity
      class Book {
          @Id
          @Column(name = "id")
          int id;
      } 

      We have to violate user's intention by throwing exception to explain that MongoDB has its hardcoded field name.

       

      Note: the above second requirement has been excluded from this ticket and in the scope of its own ticket at https://jira.mongodb.org/browse/HIBERNATE-56

            Assignee:
            Nathan Xu (Inactive)
            Reporter:
            Tom Selander
            None
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: