Skip to content
Snippets Groups Projects
Verified Commit 9fc93905 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

DOC: update Changelog and some formatting of SQL statements

parent 902b0648
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
* #51 - name queries (e.g. `FIND ENTITY WITH name = ...`)
- #27 - star matches slashes (e.g. for `FIND ... STORED AT /*.dat`).
- #30 - file path cannot be in quotes
- #46 - Server-side scripting failed as an unprivileged user because the was no
......
......@@ -37,7 +37,10 @@ public class MySQLGetIDByName extends MySQLTransaction implements GetIDByNameImp
}
public static final String STMT_GET_ID_BY_NAME =
"Select n.entity_id AS id from name_data as n JOIN entities as e ON (n.domain_id=0 and n.property_id=20 and e.id = n.entity_id) and n.value=?";
"Select n.entity_id AS id "
+ "FROM name_data AS n JOIN entities AS e "
+ "ON (n.domain_id=0 AND n.property_id=20 AND e.id = n.entity_id)"
+ "WHERE n.value=?";
public static final String STMT_AND_ROLE = " AND e.role=?";
public static final String STMT_NOT_ROLE = " AND e.role!='ROLE'";
public static final String STMT_LIMIT = " LIMIT ";
......
......@@ -16,9 +16,12 @@ public class MySQLInsertEntityDatatype extends MySQLTransaction
}
public static final String STMT_INSERT_ENTITY_DATATYPE =
"INSERT INTO data_type (domain_id, entity_id, property_id, datatype) SELECT 0, 0, ?, ( SELECT entity_id from name_data where domain_id = 0 and property_id = 20 and value = ? LIMIT 1);";
"INSERT INTO data_type (domain_id, entity_id, property_id, datatype) "
+ "SELECT 0, 0, ?, "
+ "( SELECT entity_id FROM name_data WHERE domain_id = 0 AND property_id = 20 AND value = ? LIMIT 1);";
public static final String STMT_INSERT_ENTITY_COLLECTION =
"INSERT INTO collection_type (domain_id, entity_id, property_id, collection) SELECT 0, 0, ?, ?;";
"INSERT INTO collection_type (domain_id, entity_id, property_id, collection) "
+ "SELECT 0, 0, ?, ?;";
@Override
public void execute(final SparseEntity entity) {
......
......@@ -39,7 +39,12 @@ public class MySQLRetrieveDatatypes extends MySQLTransaction implements Retrieve
}
private static final String STMT_GET_DATATYPE =
"select id AS ParentID, (SELECT value FROM name_data WHERE domain_id = 0 AND entity_ID = e.id AND property_id = 20) AS ParentName, description as ParentDescription, role as ParentRole, (SELECT acl FROM entity_acl as a WHERE a.id=e.acl) as ACL from entities as e where e.role='DATATYPE'";
"SELECT id AS ParentID, "
+ "(SELECT value FROM name_data WHERE domain_id = 0 AND entity_ID = e.id AND property_id = 20) AS ParentName, "
+ "description AS ParentDescription, "
+ "role AS ParentRole, "
+ "(SELECT acl FROM entity_acl AS a WHERE a.id=e.acl) as ACL "
+ "FROM entities AS e WHERE e.role='DATATYPE'";
@Override
public ArrayList<VerySparseEntity> execute() throws TransactionException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment