ActiveRecord Lock Table Name Conflict

When you run a reserved word, such as "User" in NHibernate, you simply add single quotes around the text that causes the violation, and nHibernate will surround the text with square brackets for the request. My question is: how do you do the same using Castle.ActiveRecord?

+3
source share
2 answers

In fact, the portable way to express this uses backlinks, for example:

[ActiveRecord("`User`")]
class User {}

From the NHibernate column class :

If the value is passed in wrapped `then NHibernate will indicate the column whenever SQL is created for it. As a column quoted depends on the dialect.

+3

:

[ActiveRecord("[User]")]
    public class User : ActiveRecordBase
+1

Source: https://habr.com/ru/post/1743669/


All Articles