#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 Chris Stewart · Oct 7, 2016

Hi


I have been working on changing a web application from using %FileBinaryStream to storing and serving the file content from a %Stream.GlobalBinary property, stored in a new database.  I have managed to migrate the data across, and have also been able to redirect the stream so that it is being served through the web link.  However, the previous method set attributes on the File stream to have the stream be rendered as the original file type through MIME, using this code

do stream.SetAttribute("ContentDisposition","inline; filename="_filecvt)

2
0 1098
Question Rustam Ibragimov · Aug 5, 2016

Hello, guys.

I need to copy the text from one stream to another filestream and save it. I am using  

do fileStream.CopyFromAndSave(rtn.Code)

However, if "rtn" stream contains Russian characters I get something like "???". Is there any way to convert stream to Unicode?  Something like $zc(str, "O", "UTF8") for streams.

3
0 453
Question Chris Bransden · Sep 29, 2016

Hi all,

We're creating a series of RESTful APIs that output data from a Cache database (made up of global storage that we've mapped to classes). I'm running into some problems with object-to-JSON conversions when relationships are involved. Eg:

ParentClass has children relationship to ChildClass

ChildClass has parent relationship to ParentClass

1
1 706
Article Eduard Lebedyuk · Sep 26, 2016 2m read

We're developing Ensemble PoC and one day our frontend developer (who doesn't have Ensemble production running) said that Populate just doesn't cut it and he needs to see the real data. He needed only one object, but the problem was - it's a big object. Still, I checked ids of everything related and wrote this command (parts omitted, but you get the idea):

1
0 779
Question sansa stark · Sep 20, 2016

Hi all,

         In CSP page we get data from Class via Query method.

         <TD valign=top>#(DEOBJ.Get("Comments").Read())#</TD>

         The problem is we couldn't get the stream property value.

        (Property Comments As %Stream.GlobalBinary)

Thanks,

sansa.

         

2
0 380
Question Ponnumani Gurusamy · Sep 15, 2016

I got a input to user . How to I print the input in another method

ClassMethod sample() As %String
{
Set Name=##class(Eam.Empdetails).%New()
"enter your name :",NameStr
Name.EmpName=NameStr
"enter your address:",NameStr1
Name.Address=NameStr1
"Enter your Phone number:",NameStr2
Name.PhoneNo =NameStr2
"Enter Your Id:",NameStr3
Name.id = NameStr3
set status = Name.%Save()
}

3
0 568
Question sansa stark · Sep 9, 2016

Hi ,

  We upgraded the cache 5.02 to cache 16.
  we are using stream property in one class .(i.e.  Property notes As Stream;) but it not support in cache 16.
 how handle this problem?

Thanks, sansa.

4
0 481
Question Ponnumani Gurusamy · Sep 8, 2016

Why we are not using database of join (inner join and outer join) concept. How to we are retrieving the data from different tables in cache. Any Concepts are using in Cache database to retrieve the data.

5
0 467
Question sansa stark · Sep 8, 2016

Hi ,

We upgraded cache 5.02 to cache 16.In this version it is having problem with "$$$" macros.

These are the error's eating my time. i tried to figure it out but there is no exact solution .

MPP5610 : Referenced macro not defined: 'CSPSessionTimeout'
MPP5610 : Referenced macro not defined: 'CacheError'

I checked the check list also "These macros will be the only ones displayed by StudioAssist when the sequence, “$$$”, is recognized during program input. The full set of macros and their definition can be displayed via the $SYSTEM.OBJ.ShowMacros method"
3
0 300
Question Markus Neumann · Sep 2, 2016

Dear Colleagues,

Recently I am working on a Cache project should enable the customer, to update our Cache application independently from us. Our idea is a client (preferred .net) application that will copy all the necessary Cache stuff (classes, routines) into a cache database. For this, we are looking for the appropriate technology – in old times this would be a CacheDirect.

4
0 676
Question John Hotalen · Aug 31, 2016

Hello Fellow Cache Developers:  

Has anyone ever created an index on values of a list property?   If so, would you be willing to share an example?

Also, feel free to offer input and suggestions regarding use of indexes on List values.

Here is my database scenario:

Parent Class:

PropertyA - %String  

PropertyB - %Integer 

Child Class:

PropertyC - %Integer

PropertyD - list of %Integer

Data illustration:

PropertyA + PropertyB   maps to one or more occurrences of [PropertyC + list of values for PropertyD]

ABC + 90001000    maps to  6600012113 + list (86001000, 86982277, 86982271)

2
0 652
Question Rustam Ibragimov · Aug 30, 2016

I know that Cache files can be stored as XML and UDL based files. Is there any way to determine in which format the file(class, routine, dfi and so on) is stored? Because you can easily name your XML based file as class.cls and it will be perfectly valid. 

I know that one way to check whether this file is in XML format is just try to parse it like 

Set st = ##class(%XML.TextReader).ParseStream(contentStream)

if $$$ISERR(st) return $$$NO

else return $$$YES

However, is there a better way? 

4
0 399
Question Chip Gore · Jun 28, 2016

Hi -

I have 3 classes: "Class A" has a property X, "Class B" has a property which is a Class A, and I have a "Class C" which has a property of a Class B.

Class A definition

Class USER.ClassA Extends %Persistent

{

Property Propx as %String;

}

Class B definition

Class USER.ClassB Extends %Persistent

{

Property Record as USER.ClassA;

}

Class C defintion (which is where I'm having my problem)

Class USER.ClassC Extends %Persistent

{

Property BRecord As USER.ClassB;

Property ARecord As USER.ClassA [ Calculated, SqlComputeCode = { ????? }, SqlComputed ];

Method ARecordGet() as USER.ClassA

{

 quit ..BRecord.ARecord

}

}

5
0 398
Article Eduard Lebedyuk · Aug 9, 2016 2m read

Process-private Globals  can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:

  • add elements to a pool (ignoring duplicates)
  • check if an element exists in the pool

Here's the class:

2
0 990