updateBuilder 并传递一个 xml
updateBuilder and pass an xml
我正在处理一个对象的更新,当我创建它时 xml 已成功存储:
DatabaseHelper db = new DatabaseHelper(getActivity());
Dao<Demandes, Integer> demandesDao = null;
try {
demandesDao = db.getDemandesDao();
Demandes maDemande = new Demandes(xml, 0, null, 0, "", 0, null);
demandesDao.create(maDemande);
demandeId = maDemande.getId();
xml = xml.replace("<IdContactClient></IdContactClient>", "<IdContactClient>" + demandeId + "</IdContactClient>");
System.out.println(xml);
AsyncSoapCall task = new AsyncSoapCall(maDemande);
task.execute();
} catch (SQLException e) {
e.printStackTrace();
}
但是当我尝试更新时,它不起作用,而当我传递随机文本时,它看起来有效,这是因为 xml ?
DatabaseHelper db = new DatabaseHelper(getActivity());
Dao<Demandes, Integer> demandesDao = null;
try {
demandesDao = db.getDemandesDao();
UpdateBuilder<Demandes,Integer> updateBuilder = demandesDao.updateBuilder();
updateBuilder.where().eq("id", demande.getId());
updateBuilder.updateColumnValue("statutEnvoieSendLead", 1);
updateBuilder.updateColumnValue("dateEnvoieSendLead", new Date());
updateBuilder.updateColumnValue("contactWebId", slr.getOption().getContactWebID());
GoogleAnalytics ga = new GoogleAnalytics(getActivity());
ga.envoieTracker(idApplication, demandeId, logement, typeForm);
XMLSendSimulation xmlSendSimulation = new XMLSendSimulation(slr.getOption().getContactWebID());
xml = XMLGenerator.GenerateSendSimulationXml(xmlSendSimulation);
//xml = "test test test fkzejfiehzifhh ghreuhgiuhguiheuiguiehgiuhughheghiuehiue hhuih guh gheugregergergergregregergregg hgu hghhguherhrehgheghegerhgueuihguhge rge g e ger 123";
updateBuilder.updateColumnValue("xmlSimulation", xml);
updateBuilder.update();
SendSimulationReponse sr = soapContact.Simulation(xml);
openSimulation = sr.getOption().getOpenSimulation();
if (sr.getCode() == 1){
Date dateSimulation = new Date();
updateBuilder.updateColumnValue("dateEnvoieSimulation", new Date());
updateBuilder.updateColumnValue("statutEnvoieSimulation", 1);
if (openSimulation == true){
resultatDemande = 1;
} else if (openSimulation == false) {
resultatDemande = 2;
}
}
} catch (SQLException e) {
e.printStackTrace();
}
xml:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><CourtactSioux><ListeContact><IdContactClient>120000379</IdContactClient></ListeContact></CourtactSioux>
只要做一个准备好的请求就会成功,我的控制台上没有收到任何错误,但问题来自单引号。
我正在处理一个对象的更新,当我创建它时 xml 已成功存储:
DatabaseHelper db = new DatabaseHelper(getActivity());
Dao<Demandes, Integer> demandesDao = null;
try {
demandesDao = db.getDemandesDao();
Demandes maDemande = new Demandes(xml, 0, null, 0, "", 0, null);
demandesDao.create(maDemande);
demandeId = maDemande.getId();
xml = xml.replace("<IdContactClient></IdContactClient>", "<IdContactClient>" + demandeId + "</IdContactClient>");
System.out.println(xml);
AsyncSoapCall task = new AsyncSoapCall(maDemande);
task.execute();
} catch (SQLException e) {
e.printStackTrace();
}
但是当我尝试更新时,它不起作用,而当我传递随机文本时,它看起来有效,这是因为 xml ?
DatabaseHelper db = new DatabaseHelper(getActivity());
Dao<Demandes, Integer> demandesDao = null;
try {
demandesDao = db.getDemandesDao();
UpdateBuilder<Demandes,Integer> updateBuilder = demandesDao.updateBuilder();
updateBuilder.where().eq("id", demande.getId());
updateBuilder.updateColumnValue("statutEnvoieSendLead", 1);
updateBuilder.updateColumnValue("dateEnvoieSendLead", new Date());
updateBuilder.updateColumnValue("contactWebId", slr.getOption().getContactWebID());
GoogleAnalytics ga = new GoogleAnalytics(getActivity());
ga.envoieTracker(idApplication, demandeId, logement, typeForm);
XMLSendSimulation xmlSendSimulation = new XMLSendSimulation(slr.getOption().getContactWebID());
xml = XMLGenerator.GenerateSendSimulationXml(xmlSendSimulation);
//xml = "test test test fkzejfiehzifhh ghreuhgiuhguiheuiguiehgiuhughheghiuehiue hhuih guh gheugregergergergregregergregg hgu hghhguherhrehgheghegerhgueuihguhge rge g e ger 123";
updateBuilder.updateColumnValue("xmlSimulation", xml);
updateBuilder.update();
SendSimulationReponse sr = soapContact.Simulation(xml);
openSimulation = sr.getOption().getOpenSimulation();
if (sr.getCode() == 1){
Date dateSimulation = new Date();
updateBuilder.updateColumnValue("dateEnvoieSimulation", new Date());
updateBuilder.updateColumnValue("statutEnvoieSimulation", 1);
if (openSimulation == true){
resultatDemande = 1;
} else if (openSimulation == false) {
resultatDemande = 2;
}
}
} catch (SQLException e) {
e.printStackTrace();
}
xml:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><CourtactSioux><ListeContact><IdContactClient>120000379</IdContactClient></ListeContact></CourtactSioux>
只要做一个准备好的请求就会成功,我的控制台上没有收到任何错误,但问题来自单引号。