Ticket T585752
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

How to map a property to a read-only database column

Read Only XPO property that is not written to database

created 7 years ago

Hello,
I make some Trigger Updates in Database direct that are overridden by XPO after commit from there.
That drives me crazy, because it is hard to find the positions where to Reload the object to get the DB inserted values.

Is there a clean way to do that?

If not, that would solve my problem completely:

Can i suppress Updates / Inserts for specific field / properties of a xpo class?

Thanks!

Answers approved by DevExpress Support

created 7 years ago

We have added support for read-only database columns in XPO. If you would like to test this feature prior to the official 18.2 release, get the preview build in the How to map a property to a read-only database column ticket. Your feedback is welcome.

    Other Answers

    created 7 years ago (modified 7 years ago)

    Hello Fabio,

    As far as I understand, you want to set values of some columns only on the database side and not modify them when an XPO object is saved. To do this, override the Session.GetPropertiesListForUpdateInsert method, as described in the How to map a property to a calculated database column (implement a read-only persistent property) ticket. If this is not what you were looking for, please describe your scenario in greater detail.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.