Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Okay, Feel like I spent my whole life through breeze documentation. Anyways, Finally solved the issue. To be honest, this wasn't a problem in breeze (but I wonder why it doesn't override the actual <code>nameOnServer</code> when I provide one). It's an error made by one of the developers in the early stage of the database implementation (probably 6 years ago). If the database adhered to Pascal Case naming convention, things would have worked perfectly fine.</p> <p>As a solution I wrote a custom naming convention which corrects the naming convention error when it has <code>ID</code> in the name and combines it with <code>camelCase</code> naming convention.</p> <pre><code>var createInconsistenIDConvention = function () { var serverPropertyNameToClient = function (serverPropertyName, prop) { if (prop &amp;&amp; prop.isDataProperty &amp;&amp; (prop.nameOnServer &amp;&amp; prop.nameOnServer === "ID")) { return "id"; } else { var firstSection = serverPropertyName.substr(0, 1).toLowerCase(); var idSection = ""; if (serverPropertyName.substr(1).indexOf("ID") != -1) { firstSection += serverPropertyName.substr(1, serverPropertyName.substr(1).indexOf("ID")).toLowerCase() + "Id"; } else { firstSection += serverPropertyName.substr(1); } return firstSection; } } var clientPropertyNameToServer = function (clientPropertyName, prop) { if (prop &amp;&amp; prop.isDataProperty &amp;&amp; (prop.nameOnServer &amp;&amp; prop.nameOnServer.indexOf("ID") != -1)) { return prop.nameOnServer; } else { return clientPropertyName.substr(0, 1).toUpperCase() + clientPropertyName.substr(1); } } return new breeze.NamingConvention({ name: "inconsistenID", serverPropertyNameToClient: serverPropertyNameToClient, clientPropertyNameToServer: clientPropertyNameToServer }); }; </code></pre> <p>Not sure if the way I've used nameOnServer property is not correct. I couldn't find any documentation on that in breeze website.</p> <p>please note that the above code only consider situations like ID, CountryID, GameID, PersonID etc.</p> <p>Problem solved for now.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload