boolean result = false;
EntityManager em =EMF.get().createEntityManager();
try{
em.getTransaction().begin();
//This isn't finished yet, needs to handle the others
HUDXML3Blob bx = em.find(HUDXML3Blob.class, b.getId());
if (b.getCsvUrl1() !=null) {
if (!(b.getCsvUrl1().equals(bx.getCsvUrl1()))) {
bx.setCsvUrl1(b.getCsvUrl1());
}
}
if (b.getCsvUrl2() !=null) {
if (!(b.getCsvUrl2().equals(bx.getCsvUrl2()))) {
bx.setCsvUrl2(b.getCsvUrl2());
}
}
if (b.getCsvUrl3() !=null) {
if (!(b.getCsvUrl3().equals(bx.getCsvUrl3()))) {
bx.setCsvUrl3(b.getCsvUrl3());
}
}
if (b.getCsvUrl4() !=null) {
if (!(b.getCsvUrl4().equals(bx.getCsvUrl4()))) {
bx.setCsvUrl4(b.getCsvUrl4());
}
}
if (b.getCsvUrl6() !=null) {
if (!(b.getCsvUrl6().equals(bx.getCsvUrl6()))) {
bx.setCsvUrl6(b.getCsvUrl6());
}
}
if (b.getXmlUrl() != null) {
if (!(b.getXmlUrl().equals(bx.getXmlUrl()))) {
bx.setXmlUrl(b.getXmlUrl());
}
}
if (b.getCsvUrl1Indexed() != bx.getCsvUrl1Indexed()) {
bx.setCsvUrl1Indexed(b.getCsvUrl1Indexed());
}
if (b.getCsvUrl2Indexed() != bx.getCsvUrl2Indexed()) {
bx.setCsvUrl2Indexed(b.getCsvUrl2Indexed());
}
if (b.getCsvUrl3Indexed() != bx.getCsvUrl3Indexed()) {
bx.setCsvUrl3Indexed(b.getCsvUrl3Indexed());
}
if (b.getCsvUrl4Indexed() != bx.getCsvUrl4Indexed()) {
bx.setCsvUrl4Indexed(b.getCsvUrl4Indexed());
}
if (b.getCsvUrl6Indexed() != bx.getCsvUrl6Indexed()) {
bx.setCsvUrl6Indexed(b.getCsvUrl6Indexed());
}
if (b.getCsvUrl1Completed() != bx.getCsvUrl1Completed()) {
bx.setCsvUrl1Completed(b.getCsvUrl1Completed());
}
if (b.getCsvUrl2Completed() != bx.getCsvUrl2Completed()) {
bx.setCsvUrl2Completed(b.getCsvUrl2Completed());
}
if (b.getCsvUrl3Completed() != bx.getCsvUrl3Completed()) {
bx.setCsvUrl3Completed(b.getCsvUrl3Completed());
}
if (b.getCsvUrl4Completed() != bx.getCsvUrl4Completed()) {
bx.setCsvUrl4Completed(b.getCsvUrl4Completed());
}
if (b.getCsvUrl6Completed() != bx.getCsvUrl6Completed()) {
bx.setCsvUrl6Completed(b.getCsvUrl6Completed());
}
em.getTransaction().commit();
result = true;
}
catch (Exception e){System.out.println("couldn't persist: " + e); e.printStackTrace();