#Object Data Model

0 Followers · 499 Posts

An object data model is that data or code is composed of modules that combine data and procedures that work on the data.

Learn more.

Question Iryna Mykhailova · Nov 9, 2022

Hi guys!

My student asked my why his unit tests don't work as they should, and I just could answer him. Here is the simplified case.

There is a class with a required unique property Name:

Class Test.NewClass [ Abstract ]
{
Property Name As%String [ Required ];
Index NameIndex On Name [ Unique ];
}

And there is an inherited class:

Class Test.NewClass1 Extends (%Persistent, Test.NewClass)
{
}

What I expect to happen, is when I save two objects of class Test.NewClass1 with the same value of property Name, for the second one to get an error stating that it violates the unique index.

9
0 658
Question Oleksandr Demchenko · Nov 18, 2022

Hi, how do I create a trigger that will only set the value of the "Status" field for new objects, not for all available?

Class CarDealer.Order Extends (%Persistent, %Populate)
{

 Property Title As %String

 Property Status As %String(VALUELIST = ",InProgress,Done,Canceled");

Trigger setStatus [ Event = INSERT, Foreach = row/object, Time = AFTER ]
{
 &sql(update CarDealer.Order set Status = 'InProgress')
}

2
0 513
Question Smythe Smythee · Nov 16, 2022

Hi,

I

want to get the values from a serial property because my code depends upon the class serial class.

For example

Serial class

Class Data.Serial Extends %SerialObject

{

Property FirstName as %String;

Property LastName as %String;

}

Persistent class

Class Data.Persistent Extends %Persistent

{

Property MPID as %Integer;

Property Name as Name.Serial;

}

Now i need save MPID and Name(Serial class property into SQL Table ) so i am trying the below class

Class Data.TestUtil Extends %RegisteredObject

{

Method Savedata(MPID,FirstName,LastName)

{

Set tSC=0

Set Obj=##Class(Data.Persistent).%New()

Set Obj.MPID=MPID

2
0 563
Question Thembelani Mlalazi · Sep 24, 2018

I am trying to work with Java Selenium through Cache  my java programme works fine but I would like to pass parameters to the jar file form my Ensemble production. I followed this Tutorial here, For starters I wanted to copy it as it is and run that as an example but the (Stateless Service Mode Example) is not working within my eclipse environment with errors on the com.intersys. complaining about the service class. If anyone out there has had experience on this please advice all I need to do is be able to invoke my jar file within Cache(In general want to call my  java programme  within Cache

2
0 598
Question Laura Cavanaugh · Oct 26, 2022

Hello all; I am using a one-to-many relationship.  I have a Claim (one), in a relationship with Lines (many), but the Claim is storing a list of Lines IDs, rather than the Lines storing the Claim Id.  This seems upside down, and not what I expected.

Class Claim

{
    Relationship ClaimLineRel as ClaimLine [Cardinality = many, Inverse = Claim];
}

Class ClaimLine
{
    Relationship Claim as Claim [ Cardinality = one, Inverse = ClaimLineRel, OnDelete = cascade];
    Index ClaimIndex on Claim;
}

But the storage globals for Claim show data in the ClaimLine spot:

3
0 298
Question Ivan Myasnikov · Jan 21, 2019

Good day.

The issue is related to Cache Studio. I wrote a plugin for creating reports using FastReport. The plugin is called via the context menu. In this case, the class is   d ## (%ZFastReport.SourceControl) .InstallSorceControllAllNameSpace ().

Example:  https://github.com/MyasnikovIA/CacheFastReport 

1) Tell me please, can I create a context menu for calling a program, without using a version control system?

1
0 354
Question Tuan nguyen · Sep 13, 2018

I can refer to the TracerName for a given ImageFile object with the following syntax: obj.Study.Injection.GetAt(obj.InjKey).RadioTracer.TracerName

Is it possible to write an SQL statement to search the PET.ImageFile table to find a match based on the RadioTracer.TracerName?

1
0 263
Article Vivian Lee · Dec 15, 2021 3m read

Setting the Scene

I was editing the properties of a persistent ObjectScript class the other day and noticed that the storage definition wasn't updating to reflect my latest changes.

In this case, I deleted a property that was no longer needed from the class definition, saved, recompiled, and still saw it in the storage definition.

No problem, I thought. If the storage definition gets autogenerated on compile, I can just delete it and recompile the class. Sure enough, after doing this, I no longer saw the deleted property in the storage definition.

There, problem solved... right?

7
3 820
Article Joel Solon · Dec 23, 2015 1m read

In the Caché Foundations course, students are learning about Caché Development and ObjectScript syntax at the same time. To help students complete the exercises, we provide an ObjectScript Quick Reference (aka "the Cheat Sheet").

It is not a reference for all of ObjectScript! It is a list of the ObjectScript commands and functions that students use during the course, along with common syntax for objects, collections, etc. It also contains some useful macros.

We are providing a pdf version to the Developer Community.

6
0 1744
Question reach.gr G · Aug 4, 2021

Trackcare 2021.2

Please may I know  how to access SQL parameter with string as datatype with NO reference to SQL Table and SQL Column.

Hi Experts,

I have these two clarifications to make:

  1. I am struggling to understand the process and method of accessing the SQL table with no reference to SQL parameter or Table but string

This is what I tried: Tired to create ERD diagrams and try to extract Primary and Foreign keys to associate, but I cannot in this case

I would like to do something like this

6
0 3195
Article John Murray · Mar 3, 2016 2m read

The purpose of this post is to raise the profile of a powerful mechanism that has long been available to us, and to open a discussion about ways in which it can be used or abused.

You can read more detail about the mechanism here. To summarize, your class definition can use the Projection keyword to reference one or more projection classes. A projection class can implement methods that get invoked at key points in the lifecycle of your class.

A projection class must extend %Projection.AbstractProjection and will typically implement at least one or the following methods:

18
0 1652
Article Eduard Lebedyuk · Mar 24, 2017 9m read

In my previous article, we reviewed possible use-cases for macros, so let’s now proceed to a more comprehensive example of macros usability. In this article we will design and build a logging system.

Logging system

Logging system is a useful tool for monitoring the work of an application that saves a lot of time during debugging and monitoring. Our system would consist of two parts:

  • Storage class (for log records)
  • Set of macros that automatically add a new record to the log
6
10 3417
Announcement Evgeny Shvarov · Jan 11, 2021

Hi Developers!

Here're the technology bonuses for the InterSystems Multi-Model Contest that will give you extra points in the voting:

  • InterSystems Globals (key-value)
  • InterSystems SQL
  • InterSystems Objects 
  • Your data model
  • ZPM Package deployment
  • Docker container usage

See the details below.<--break->

3
1 297
Question Scott Roth · Oct 19, 2017

We are trying to convert some of our SQL Service Integration Service jobs from Visual Studio to Ensemble. If we execute a Stored Procedure within SQL Server Management Studio it is returning approx 12,000 rows. However when Ensemble executes the same Stored Procedure it is only returning 250 rows.

Is there a limitation to EnsLib.SQL.Snapshot?

This is how we are calling the Stored procedure

4
0 979