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, I'm creating an Oracle database schema for a test model I created (Model Designer unfortunately refuses to create it because of inheritance). What data type should I set for columns which map to boolean property? I guess the most efficient is char (Y,N) but probably the most expectable is NUMBER(1,0). Which data types will LightSpeed be comfortable to work with? Thanks, -md- |
|
|
Hi -md-, You're correct. LightSpeed currently implements boolean using NUMBER(1). What problem are you having with inheritance in the designer? It is supported, so please create another thread if you have an issue and we'll fix it asap. Cheers, Andrew. |
|
|
Hi Andrew, Thanks for prompt reply. As for the inheritance problem in the designer, it's not a bug, more a feature not implemented yet I guess. It would be great if I could create a model using LightSpeed VS designer and than just let it create my database schema according to created model, LightSpeed internal requirements and expectations, and best practices (I mean those which are inferable from the schema like setting primary keys, creating indexes on primary keys etc.). I hoped that model designer "Update database..." context menu item will do this but it displays message box saying "Database synchronisation is not supported for entities with inheritance relationships.". However, there is one small problem I have with model designer. Maybe I should create new thread for it. I found no way to specify discriminator on the base class of inheritance hierarchy. Have I overlooked it somewhere? It would not be a problem for me if I was creating my model entities in source, but I am generating them from meta-data of my internal framework (specifically generating .lsmodel file and then use VS model designer to generate the source). Thanks, Martin |
|
|
Hi Martin, Thanks for the feedback, we'll look at strengthening the support for schema generation when using inheritance. Regarding discriminators on the base class, you don't have to specify one as LightSpeed will default to that one if none of the other discriminators match. Let me know if this doesn't work for you, or, if you have an alternative requirement. Cheers, Andrew. |
|
|
I thought it could work like that. But that means, if I understand it correctly, that the discriminator column must be nullable - LightSpeed cannot know what to store in this column if discriminator is not specified. Or the column can be made NOT NULL and default value may specify discriminator value for the base class. Unfortunately both of these solutions weaken database model resistance to invalid data insertion. LightSpeed will probably never forget to specify discriminator column value, but DB administrator or a component accessing the database directly may, which would lead to corrupted data. That is why I would prefer the database schema not to allow omitting discriminator column value in data manipulation queries. That is just to explain my motivations, I understand your solution to the problem. Thanks, Martin |
|
|
Hi Martin, I'm pretty sure it's supported in the core framework so we'll look at adding it to the designer this week. Cheers, Andrew. |
|