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
|
When dragging tables from the Severexplorer in VS2008 into the Lightspeed designer, I sometimes get the errormessage below. I don't see what is wrong with those tables. Can anybody help me out what the errormessage exactly means? Exception while processing Server Explorer drag: System.NullReferenceException: Object reference not set to an instance of an object. at Mindscape.LightSpeed.Generator.Integration.EntityConverter.CopyRelationships(EntityModel generatorEntity, Entity entity) at Mindscape.LightSpeed.Generator.Integration.EntityConverter.PopulateEntities() at Mindscape.LightSpeed.Generator.Integration.EntityBuilder.AddTablesToModel(Model model, IDbConnection connection, IEnumerable`1 tableNames, IGenerationLog log) at Mindscape.LightSpeed.Generator.Integration.LightSpeedModelDiagram.<>c__DisplayClass4.<OnDragDrop>b__3(DragObject dragObject, IGenerationLog log) at Mindscape.LightSpeed.Generator.Integration.ServerExplorer.IfIsServerExplorerDrag(DragEventArgs e, DragAction action)
|
|
|
This looks like a bug in our association inference, probably related to foreign key columns which do not match LightSpeed's default naming convention. Would you be able to provide your Oracle CREATE TABLE scripts showing
the related tables so we can reproduce the problem and get it fixed for you? Thanks! |
|
|
Ivan, Here is the create script from the Oracle database on a table that gives the problem. The table that is related through the foreign key was added with no problem to the lightspeed diagram. CREATE TABLE "REAFORCE25"."" ("UBGID" NUMBER NOT NULL, "AK" FLOAT(126), "AKAV" NUMBER, "APP" NUMBER, "AWON" NUMBER, "BENB" FLOAT(126), "BIJKK" FLOAT(126), "BK" FLOAT(126), "BKGVK" FLOAT(126), "BKK" FLOAT(126), "BKOPB" FLOAT(126), "BOPBEX" FLOAT(126), "BOPBLI" FLOAT(126), "BOPBMMWH" FLOAT(126), "BOPBMMWK" FLOAT(126), "BOPBOVR" FLOAT(126), "BOPBSB" FLOAT(126), "BTW" FLOAT(126), "DBK" FLOAT(126), "DBKAK" FLOAT(126), "DBKAM" FLOAT(126), "DBKAMD" FLOAT(126), "DBKAMT" FLOAT(126), "DBKAO" FLOAT(126), "DBKAOA" FLOAT(126), "DBKAOB" FLOAT(126), "DBKAOC" FLOAT(126), "DBKAOI" FLOAT(126), "DBKAOV" FLOAT(126), "DBKLHV" FLOAT(126), "DBKPK" FLOAT(126), "DBKVHK" FLOAT(126), "DBKVKK" FLOAT(126), "DTMEB" DATE, "DTMEP" DATE, "DTMSB" DATE, "DTMSO" DATE, "EXTK" FLOAT(126), "FK" FLOAT(126), "FVG" FLOAT(126), "GBK" FLOAT(126), "GK" FLOAT(126), "GW" FLOAT(126), "IK" FLOAT(126), "IVK" FLOAT(126), "LINRK" FLOAT(126), "M2BVO" FLOAT(126), "M2BVOBHV" FLOAT(126), "M2BVOPARK" FLOAT(126), "M2TOPARK" FLOAT(126), "M2BVOWOON" FLOAT(126), "MMW" FLOAT(126), "MMWB" FLOAT(126), "MMWH" FLOAT(126), "MMWK" FLOAT(126), "OBK" FLOAT(126), "ODBK" FLOAT(126), "OGK" FLOAT(126), "ONTRIS" FLOAT(126), "ONTWIN" FLOAT(126), "OPB" FLOAT(126), "OVZ" FLOAT(126), "PAK" FLOAT(126), "RVKW" FLOAT(126), "RHG" FLOAT(126), "RL" FLOAT(126), "RLH" FLOAT(126), "RLV" FLOAT(126), "RV" FLOAT(126), "RVH" FLOAT(126), "RVV" FLOAT(126), "SK" FLOAT(126), "TK" FLOAT(126), "VE" FLOAT(126), "VKOPB" FLOAT(126), "VKOPBBTW" FLOAT(126), "VKW" FLOAT(126), "VKWG" FLOAT(126), "VKWO" FLOAT(126), "VOZK" FLOAT(126), "PDBKPM" FLOAT(126), "DBKPM" FLOAT(126), "VBTSB" FLOAT(126), "GEMVB" FLOAT(126), "MAXVB" FLOAT(126), "DTMMAXVB" DATE, "PCR" FLOAT(126), "AKOOPRIJ" NUMBER, "AKOOPAPP" NUMBER, "AHUURRIJ" NUMBER, "AHUURAPP" NUMBER, "APPGEB" NUMBER, "APPMV" NUMBER, "DTMGA" DATE, "VBT" NUMBER, "BT" NUMBER, "DTMEOHT" DATE, "DTMEHG" DATE, "OWEB" NUMBER, "DTMSV" DATE, "DTMEV" DATE, "GWPD" FLOAT(126), "GWRDSTG" FLOAT(126), "DBKK" FLOAT(126), "BKKABK" FLOAT(126), "BKKCVB" FLOAT(126), "BKKAK" FLOAT(126), "BKKWR" FLOAT(126), "BKKPD" FLOAT(126), "WBKI" FLOAT(126), "ETI" FLOAT(126), "TI" FLOAT(126), "GOI" FLOAT(126), "DIKPD" FLOAT(126), "IKABK" FLOAT(126), "IKAK" FLOAT(126), "IKWR" FLOAT(126), "IKPD" FLOAT(126), "GBKPD" FLOAT(126), "TKPD" FLOAT(126), "TKABK" FLOAT(126), "TKAK" FLOAT(126), "TKWR" FLOAT(126), "DTKPD" FLOAT(126), "BKPD" FLOAT(126), "BKIVSB" FLOAT(126), "BKITB" FLOAT(126), "VKWPD" FLOAT(126), "VWRDSTG" FLOAT(126), "BW" FLOAT(126), "ONRTOP" FLOAT(126), "M2BVOKANTOREN" FLOAT(126), "M2BVOWINKELS" FLOAT(126), "M2BVOBEDRIJFSRUIMTE" FLOAT(126), "VKST" FLOAT(126), "DTMIV" DATE, "AWOONNIEUWBOUW" NUMBER, "AWOONRENOVATIE" NUMBER, "APPNIEUWBOUW" NUMBER, "APPRENOVATIE" NUMBER, "ABHVNIEUWBOUW" NUMBER, "ABHVRENOVATIE" NUMBER, "BTWGVW" FLOAT(126), "NTTVBTW" FLOAT(126), "NATDBTW" FLOAT(126), "GEWBARHUUR" FLOAT(126), "GEWONTWINHUUR" FLOAT(126), "GEWONTWINKOOP" FLOAT(126), "DBKREN" FLOAT(126), "PONTWIN" FLOAT(126), "M2BVOLEISURE" FLOAT(126), "M2BVOUTILITAIR" FLOAT(126), "M2BVOMOTEL" FLOAT(126), "M2BVOHOTEL" FLOAT(126), "M2BVORESTAURANT" FLOAT(126), "M2BVOCAFE" FLOAT(126), "M2BVOBIOSCOOP" FLOAT(126), "M2BVODISCOTHEEK" FLOAT(126), "M2BVOSTADION" FLOAT(126), "M2BVOEXPOSITIE" FLOAT(126), "M2BVOLEISUREOVERIG" FLOAT(126), "M2BVOKINDEROPVANG" FLOAT(126), "M2BVOBASISONDERWIJS" FLOAT(126), "M2BVOVOORTGEZETONDERWIJS" FLOAT(126), "M2BVOMIDDELBAARONDERWIJS" FLOAT(126), "M2BVOHOGERONDERWIJS" FLOAT(126), "M2BVOWETENSCHAPONDERWIJS" FLOAT(126), "M2BVOONDERWIJSOVERIG" FLOAT(126), "M2BVOKLINIEK" FLOAT(126), "M2BVOZIEKENHUIS" FLOAT(126), "M2BVOGEZONDHEID" FLOAT(126), "M2BVOVERPLEEGHUIS" FLOAT(126), "M2BVOSOCIAALWERKPLAATS" FLOAT(126), "M2BVOINSTELGGZ" FLOAT(126), "M2BVOINSTELVG" FLOAT(126), "M2BVOMULTIFUNCTIONEEL" FLOAT(126), "M2BVOBEJAARDENHUIS" FLOAT(126), "M2BVOZORGOVERIG" FLOAT(126), "M2BVOSTALLINGSGEBOUW" FLOAT(126), "M2BVOSTATIONSGEBOUW" FLOAT(126), "M2BVODISTRIBUTIECENTRA" FLOAT(126), "M2BVOMOBILITEITOVERIG" FLOAT(126), "M2BVOBRANDWEER" FLOAT(126), "M2BVOGEMEENTEHUIS" FLOAT(126), "M2BVOGERECHTSGEBOUW" FLOAT(126), "M2BVOGEVANGENIS" FLOAT(126), "M2BVOJONGEREN" FLOAT(126), "M2BVOPOLITIEBUREAU" FLOAT(126), "M2BVOPROVINCIEHUIS" FLOAT(126), "M2BVOMINISTERIE" FLOAT(126), "M2BVOOVERHEIDOVERIG" FLOAT(126), "M2BVOBIBLIOTHEEK" FLOAT(126), "M2BVOCONCERTGEBOUW" FLOAT(126), "M2BVOMUSEUM" FLOAT(126), "M2BVOSCHOUWBURG" FLOAT(126), "M2BVOCONGRESGEBOUW" FLOAT(126), "M2BVOCULTUUROVERIG" FLOAT(126), "VKWPEPD" FLOAT(126), "VKWPE" FLOAT(126), "IRR" FLOAT(126), "VFVG" FLOAT(126), "PDBKVTU" FLOAT(126), "KBM" FLOAT(126), "ONRTOPPS" FLOAT(126), "TEOPBRENGSTEN" FLOAT(126), "TELASTEN" FLOAT(126), "INBRENGWAARDE" FLOAT(126), "DTMSA" DATE, "ABT" NUMBER, CONSTRAINT "FK_UBEGB_BEGID_BEGB_BEGID" FOREIGN KEY("UBGID") REFERENCES "REAFORCE25"."BOUWEENHEIDGEBOUW"("BEGID"), CONSTRAINT "PK_UBEGB_UBGID" PRIMARY KEY("UBGID") USING INDEX TABLESPACE "USERS" STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0) PCTFREE 10 INITRANS 2 MAXTRANS 255) TABLESPACE "USERS" PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0) LOGGING |
|
|
The problem appears to be that the UBGID column is both the identity (primary key) *and* a foreign key to the Bouweenheidgebouw table. Is this what you intended? In any case, we will fix the error that you are seeing so that you can drag the table; however you will probably need to create the relationship manually because we don't normally expect an identity column to be a foreign key. If this is your situation, you may also run into problems performing inserts because LightSpeed will not realise that the association ID reference and the identity are meant to be the same thing, and will attempt to assign its own value to the identity. If you can tell us a bit more about your domain model, the way the database is designed, and constraints on changes to the database (I am assuming this is an existing database and you cannot make major changes) then we may be able to offer some advice on possible techniques. |
|
|
I have committed a fix for the designer error and this will be included in nightly builds dated 22 October 2008 and above. So you should now be able to drag the table on; however as discussed above you may run into some issues if you are creating new instances of it. (I also noticed in your CREATE TABLE script that the table appeared to have no name. I assume this was a glitch in capturing the SQL (or that I misread it) and that the table in the database does have a name. We would not be able to handle nameless tables.) |
|
|
Ivan It was designed this way. Becasuse of the size of the table we have designed a number of 1:1 relations where the primary key is intended to be the foreign key also. In a domain model it is designes as a nested class. Databases however do not support this
Robert |
|
|
The tables do have names It was just a partial piece of SQL structure. Thanx for the fast support. Is there a special place where I can download the patch when it's available?
Robert |
|
|
Yes, sorry, forgot to include the link: you can get Express edition updates from http://www.mindscape.co.nz/products/lightspeed/nightlybuilds.aspx, and retail edition updates from the store. The patch is available now. |
|
|
Thanx Ivan, The dragging of the 1:1 tables from ORACLE works now for the designer. I let you know if I run into problems with updating and inserting |
|