Skip to content

Instantly share code, notes, and snippets.

View MichaH's full-sized avatar

Micha MichaH

View GitHub Profile
@MichaH
MichaH / RestartGfallVog.java
Created August 13, 2018 13:17
FilterCriterion
FilterCriterion c1 = new FilterCriterion(
AufgabeSelectFilter.Criterion.AUFGABENAME_LIKE, vopa.getNextTask());
FilterCriterion c2 = new FilterCriterion(
AufgabeSelectFilter.Criterion.FALLID_EQ, vopa.getGfallId());
FilterAndList andFilter = new FilterAndList(c1, c2);
TreeSelectFilter selectFilter = new AufgabeSelectFilter(andFilter);
List<AufgabeLW> aufgabenListe = AufgabeLWHome.getDefault().findAll(selectFilter, em);
@MichaH
MichaH / AdapterStatusCode.java
Last active April 5, 2016 06:42
The http status codes (source: wikipedia) cast into an enum class; german descriptions as comments
/*
* O R A N G E O B J E C T S
* http://www.OrangeObjects.de
*
*/
package com.orangeobjects.abest.trans.async;
/**
*
* @author Michael Hofmann <Michael.Hofmann@OrangeObjects.de>
@MichaH
MichaH / isSameXMLContent
Created October 29, 2014 16:51
A diff for two XML-InputStreams
private static boolean isSameXMLContent(InputStream s1, InputStream s2)
throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setCoalescing(true);
dbf.setIgnoringElementContentWhitespace(true);
dbf.setIgnoringComments(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc1 = db.parse(s1);
doc1.normalizeDocument();