com.capitalone.dashboard.model.BaseModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Core package shared by API layer and Microservices
package com.capitalone.dashboard.model;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
/**
* Base class for all Mongo model classes that has an id property.
*/
public class BaseModel {
@Id
private ObjectId id;
public ObjectId getId() {
return id;
}
public void setId(ObjectId id) {
this.id = id;
}
/*
* Note:
*
* Having hashcode + equals is more complicated than simply comparing ObjectIds since
* it does not provide a way to properly compare models that have not been saved yet.
*/
}