package com.grigowashere.aismap.data.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.grigowashere.aismap.data.entity.VesselEntity;

@Dao
public interface VesselDao {
	@Insert(onConflict = OnConflictStrategy.REPLACE)
	long upsert(VesselEntity entity);

	@Update
	void update(VesselEntity entity);

	@Query("SELECT * FROM own_vessel ORDER BY id DESC LIMIT 1")
	VesselEntity getLatest();
}


