Improved query for retrieving content sections

deploy_packages_to_gitea
Jens Pelzetter 2023-03-11 19:40:48 +01:00
parent fe74176563
commit d41a372ef3
4 changed files with 17 additions and 5 deletions

View File

@ -1,12 +1,12 @@
{
"name": "@librecms/ccm-cms",
"version": "7.0.0-SNAPSHOT.2023-02-26T075448",
"version": "7.0.0-SNAPSHOT.2023-03-11T125333",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@librecms/ccm-cms",
"version": "7.0.0-SNAPSHOT.2023-02-26T075448",
"version": "7.0.0-SNAPSHOT.2023-03-11T125333",
"license": "LGPL-3.0-or-later",
"dependencies": {
"@tiptap/core": "^2.0.0-beta.127",

View File

@ -1,6 +1,6 @@
{
"name": "@librecms/ccm-cms",
"version": "7.0.0-SNAPSHOT.2023-02-26T075448",
"version": "7.0.0-SNAPSHOT.2023-03-11T125333",
"description": "JavaScript stuff for ccm-cms",
"main": "target/generated-resources/assets/@content-sections/cms-admin.js",
"types": "target/generated-resources/assets/@content-sections/cms-admin.d.ts",

View File

@ -65,6 +65,10 @@ import static org.librecms.CmsConstants.*;
@Entity
@Table(name = "CONTENT_SECTIONS", schema = DB_SCHEMA)
@NamedQueries({
@NamedQuery(
name = "ContentSection.findAll",
query = "SELECT s FROM ContentSection s"
),
@NamedQuery(
name = "ContentSection.findById",
query = "SELECT s FROM ContentSection s WHERE s.objectId = :objectId"),

View File

@ -23,6 +23,7 @@ import org.libreccm.core.CoreConstants;
import org.libreccm.security.AuthorizationRequired;
import org.libreccm.security.RequiresPrivilege;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
@ -41,6 +42,13 @@ public class ContentSectionRepository
private static final long serialVersionUID = 4616599498399330865L;
@Override
public List<ContentSection> findAll() {
return getEntityManager()
.createNamedQuery("ContentSection.findAll", ContentSection.class)
.getResultList();
}
public Optional<ContentSection> findByUuid(final String uuid) {
try {
return Optional.of(