web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

SaveContents property on the table fields

Volodymyr Giginiak Profile Picture Volodymyr Giginiak
I've opened for myself the new great property of the table fields - SaveContents. This property defines whether field will be physically created in the database (Yes) or will it just be present on the table buffer (No). It can be quite useful to have such kind of fields if you want to avoid redundancies in the database but you need to perform some complex calculations/queries and use their results on the table buffer. To get these fields filled with values you have to override the postLoad() method on the table.
For example, let you have the table:

Table1
IntField1 : Int, SaveContents = Yes
IntField2 : Int, SaveContents = Yes
IntField3 : Int, SaveContents = No

If you'll override postLoad() method on the Table1 like:

public void postLoad()
{
    this.IntField3 = this.IntField1 + this.IntField2;
}

then you'll get the IntField3 field filled with the sum of the other two field values. The postLoad() method will be executed on each query on Table1 table. That is huge drawback because of serious performance degradation, however it still can be useful sometimes.

This was originally posted here.

Comments

*This post is locked for comments