Improved query for retrieving content sections
parent
fe74176563
commit
d41a372ef3
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@librecms/ccm-cms",
|
"name": "@librecms/ccm-cms",
|
||||||
"version": "7.0.0-SNAPSHOT.2023-02-26T075448",
|
"version": "7.0.0-SNAPSHOT.2023-03-11T125333",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@librecms/ccm-cms",
|
"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",
|
"license": "LGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/core": "^2.0.0-beta.127",
|
"@tiptap/core": "^2.0.0-beta.127",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@librecms/ccm-cms",
|
"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",
|
"description": "JavaScript stuff for ccm-cms",
|
||||||
"main": "target/generated-resources/assets/@content-sections/cms-admin.js",
|
"main": "target/generated-resources/assets/@content-sections/cms-admin.js",
|
||||||
"types": "target/generated-resources/assets/@content-sections/cms-admin.d.ts",
|
"types": "target/generated-resources/assets/@content-sections/cms-admin.d.ts",
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,10 @@ import static org.librecms.CmsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "CONTENT_SECTIONS", schema = DB_SCHEMA)
|
@Table(name = "CONTENT_SECTIONS", schema = DB_SCHEMA)
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
|
@NamedQuery(
|
||||||
|
name = "ContentSection.findAll",
|
||||||
|
query = "SELECT s FROM ContentSection s"
|
||||||
|
),
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "ContentSection.findById",
|
name = "ContentSection.findById",
|
||||||
query = "SELECT s FROM ContentSection s WHERE s.objectId = :objectId"),
|
query = "SELECT s FROM ContentSection s WHERE s.objectId = :objectId"),
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import org.libreccm.core.CoreConstants;
|
||||||
import org.libreccm.security.AuthorizationRequired;
|
import org.libreccm.security.AuthorizationRequired;
|
||||||
import org.libreccm.security.RequiresPrivilege;
|
import org.libreccm.security.RequiresPrivilege;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -41,6 +42,13 @@ public class ContentSectionRepository
|
||||||
|
|
||||||
private static final long serialVersionUID = 4616599498399330865L;
|
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) {
|
public Optional<ContentSection> findByUuid(final String uuid) {
|
||||||
try {
|
try {
|
||||||
return Optional.of(
|
return Optional.of(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue