All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mangoo.persistence.Entity Maven / Gradle / Ivy

The newest version!
package io.mangoo.persistence;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.mangoo.persistence.interfaces.BaseEntity;
import org.bson.codecs.pojo.annotations.BsonId;
import org.bson.codecs.pojo.annotations.BsonProperty;
import org.bson.types.ObjectId;

public class Entity implements BaseEntity {
    @BsonId
    @BsonProperty("_id")
    @JsonSerialize(using = ToStringSerializer.class)
    protected ObjectId id;

    @Override
    public ObjectId getId() {
        return id;
    }

    @Override
    public void setId(ObjectId id) {
        this.id = id;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy