Updating dao with a new query
This commit is contained in:
parent
0be4898b7d
commit
132aeadd54
@ -1,5 +1,6 @@
|
|||||||
package fr.romanet.vj.apps.myrealestateagency.dao;
|
package fr.romanet.vj.apps.myrealestateagency.dao;
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData;
|
||||||
import androidx.room.Dao;
|
import androidx.room.Dao;
|
||||||
import androidx.room.Insert;
|
import androidx.room.Insert;
|
||||||
import androidx.room.Query;
|
import androidx.room.Query;
|
||||||
@ -12,11 +13,14 @@ import fr.romanet.vj.apps.myrealestateagency.entities.Agent;
|
|||||||
public interface AgentDao {
|
public interface AgentDao {
|
||||||
|
|
||||||
@Query("SELECT * FROM agent")
|
@Query("SELECT * FROM agent")
|
||||||
List<Agent> getAgentList();
|
LiveData<List<Agent>> getAgentList();
|
||||||
|
|
||||||
@Query("SELECT agency_name FROM agency INNER JOIN agent ON agent.agent_id = agency.agency_id WHERE agent.agency_employer_id = :idAgencyEmployer")
|
@Query("SELECT agency_name FROM agency INNER JOIN agent ON agent.agent_id = agency.agency_id WHERE agent.agency_employer_id = :idAgencyEmployer")
|
||||||
String getAgencyName(int idAgencyEmployer);
|
String getAgencyName(int idAgencyEmployer);
|
||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
void insertAgent(Agent agent);
|
void insertAgent(Agent agent);
|
||||||
|
|
||||||
|
@Insert
|
||||||
|
void insertPreAgents(Agent[] agents);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user