I have a person entity with two simple fields:
class Customer {
@Id
String id
String firstName
String lastName
}
by doing a simple save on that entity, using spring mongo repository:
repository.save(new Customer(firstName: "Sylvannas", lastName: 'Thrall'))
repository.save(new Customer(firstName: "Princess", lastName: 'Peach'))
Insert the following in my collection:
_id: 59b7a2c3c3b53e60dd1c00f9
_class:"com.application.mongosample.domain.entity.Customer"
firstName: "Sylvannas"
lastName: "Thrall"
_id: 59b7a2c3c3b53e60dd1c00fa
_class: "com.application.mongosample.domain.entity.Customer"
firstName: "Princess"
lastName: "Peach"
What I do not like is that I insert the name of the class package into the database and I do not see the usefulness of this function.
How do I eliminate this hibernate behavior?