Improved query for retrieving content sections
parent
fe74176563
commit
d41a372ef3
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
|
|
@ -253,11 +257,11 @@ public class ContentSection
|
|||
protected void addFolder(final Folder folder) {
|
||||
folders.add(folder);
|
||||
}
|
||||
|
||||
|
||||
protected void removeFolder(final Folder folder) {
|
||||
folders.remove(folder);
|
||||
}
|
||||
|
||||
|
||||
protected void setFolders(final Set<Folder> folders) {
|
||||
this.folders = new HashSet<>(folders);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue