This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi All, Just getting back into LS after far too long. I needed to get the names of the fields from an object, so used the field attribute constants which was handy. When looking through the code generated by the model UI to understand it all a bit better, it occurred to me that the calls to Get and Set use an explicit string for the propertyName parameter rather than the field attribute constants defined. Is there a reason for this ? Cheers Paul |
|
|
Uh, because we wrote the code generator for the getter and setter bits before we wrote the code generator for the field names, and never went back and updated the getter and setter bits. No, there's no reason. Because it's generated code, there's not really much value in referring to the constants (because the literals will be regenerated whenever the constants are), so we never felt the urge to change the working code. |
|
|
Thanks Ivan, was just making sure I wasn't missing some sort of subtle usage {:O) |
|
|
Can you add the field attribute constants for the generated fields (CreatedOn, UpdatedOn, ...)? I'm building custom sorts and filters and it would be nice to catch things that are missing from the models. |
|
|
The names are fixed, so you can easily create the constants yourself. Or do you mean on a per-class basis, so that the constant would only exist in the entity if the field existed in the entity? |
|
|
Exactly: per entity so I can trick some compile-time checking out of the system. |
|
|
This will be in the next nightly build. |
|