diff --git a/inception/inception-io-xml/src/main/resources/META-INF/asciidoc/user-guide/formats-xml-custom.adoc b/inception/inception-io-xml/src/main/resources/META-INF/asciidoc/user-guide/formats-xml-custom.adoc index b0cdcb64c6e..5ffa0cec429 100644 --- a/inception/inception-io-xml/src/main/resources/META-INF/asciidoc/user-guide/formats-xml-custom.adoc +++ b/inception/inception-io-xml/src/main/resources/META-INF/asciidoc/user-guide/formats-xml-custom.adoc @@ -53,17 +53,17 @@ tt|p { border-radius: 0.5em; margin-top: 0.25em; margin-bottom: 0.25em; +} - &::before { - border-radius: 0.5em 0em 0em 0.5em; - display: inline-block; - padding-left: 0.5em; - padding-right: 0.5em; - margin-right: 0.5em; - background-color: lightgray; - min-width: 10em; - content: attr(agent) '\a0'; - } +tt|p::before { + border-radius: 0.5em 0em 0em 0.5em; + display: inline-block; + padding-left: 0.5em; + padding-right: 0.5em; + margin-right: 0.5em; + background-color: lightgray; + min-width: 10em; + content: attr(agent) '\a0'; } ---- diff --git a/inception/inception-preferences/src/main/java/de/tudarmstadt/ukp/inception/preferences/PreferencesServiceImpl.java b/inception/inception-preferences/src/main/java/de/tudarmstadt/ukp/inception/preferences/PreferencesServiceImpl.java index 4cebf8a9d92..96b7d995d1a 100644 --- a/inception/inception-preferences/src/main/java/de/tudarmstadt/ukp/inception/preferences/PreferencesServiceImpl.java +++ b/inception/inception-preferences/src/main/java/de/tudarmstadt/ukp/inception/preferences/PreferencesServiceImpl.java @@ -21,6 +21,7 @@ import static java.util.Objects.requireNonNull; import java.io.IOException; +import java.lang.invoke.MethodHandles; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -41,6 +42,7 @@ import de.tudarmstadt.ukp.inception.preferences.model.DefaultProjectPreference; import de.tudarmstadt.ukp.inception.preferences.model.UserPreference; import de.tudarmstadt.ukp.inception.preferences.model.UserProjectPreference; +import de.tudarmstadt.ukp.inception.preferences.model.UserProjectPreference_; import de.tudarmstadt.ukp.inception.support.json.JSONUtil; /** @@ -52,7 +54,7 @@ public class PreferencesServiceImpl implements PreferencesService { - private static final Logger LOG = LoggerFactory.getLogger(PreferencesServiceImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final @PersistenceContext EntityManager entityManager; @@ -243,14 +245,14 @@ public List listUserPreferencesForProject(Project aProjec { requireNonNull(aProject, "Parameter [project] must be specified"); - String query = String.join("\n", // - "FROM UserProjectPreference ", // - "WHERE project = :project"); + var builder = entityManager.getCriteriaBuilder(); + var query = builder.createQuery(UserProjectPreference.class); + var root = query.from(UserProjectPreference.class); - return entityManager // - .createQuery(query, UserProjectPreference.class) // - .setParameter("project", aProject) // - .getResultList(); + query.select(root); + query.where(builder.equal(root.get(UserProjectPreference_.project), aProject)); + + return entityManager.createQuery(query).getResultList(); } @Override diff --git a/inception/inception-preferences/src/main/resources/de/tudarmstadt/ukp/inception/preferences/model/db-changelog.xml b/inception/inception-preferences/src/main/resources/de/tudarmstadt/ukp/inception/preferences/model/db-changelog.xml index 9f791a87ac7..6ce5005e232 100644 --- a/inception/inception-preferences/src/main/resources/de/tudarmstadt/ukp/inception/preferences/model/db-changelog.xml +++ b/inception/inception-preferences/src/main/resources/de/tudarmstadt/ukp/inception/preferences/model/db-changelog.xml @@ -118,9 +118,7 @@ - - - + user IS NULL @@ -134,9 +132,7 @@ - - - + user IS NULL @@ -146,11 +142,9 @@ - - - + - + project IS NULL