Question
YURI MARX GOMES · Jun 27, 2020

Example list persistent classes with name, type, primary key and foreign keys using %Dictionary

Hi guys,

Do you have any objectscript sample to list persistent classes with name, type, primary key and foreign keys using %Dictionary?

10
1 2 1 156
Log in or sign up to continue

Replies

Persistent classes:

SELECT Name
FROM %Dictionary.ClassDefinition_SubclassOf('%Persistent')

List properties and relationships (if you need subset - filter by parent - it's a class):

SELECT
parent,  Name, Cardinality, Collection, Id, _Identity,  Relationship, Type
FROM %Dictionary.CompiledProperty

Foreign keys:

SELECT
parent, Name, Properties, ReferencedClass, ReferencedKey
FROM %Dictionary.ForeignKeyDefinition

For everything %Dictionary.Compiled* - includes defined and inherited values, Definitions include only items defined in a current class.