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
|
Good Evening, I have downloaded your express version of Lightspeed. I have viewed all you screen cast and review the help and example documentation. I develop code for the retail clothing industry and my product is an interface between their transportation consolidators, long haul transportation companies and their warehouse and inventory system. I have got some basic tests running with Lightspeed and like the way it works. This correspondence is to ask how to get a more advance version running, like I would have in my product. The product has a number of tables but I only want to talk about four that I would like to build a sample/test around. I have four tables, Manifest, Carrier, Detail, and Vendors.The Manifest table has a reference to the Carrier table (FK Carrier[Id] => CarrierId)There are one or more Detail records (Detail Table) for each Mainfest (FK Manifest[Id] => ManifestId)Each Detail Record has a reference to the Vendor table (FK Vendor[Id] => VendorId)Create table [Carriers] ( [Id] Integer IDENTITY (101, 1) NOT NULL PRIMARY KEY, [Name] Varchar (50) NULL, [Contact] Varchar (30) NULL, [Telephone] Varchar (30) NULL, [IsDeleted] Bit NOT NULL DEFAULT 0) Create table [Details] ( [Id] Integer IDENTITY (1001, 1) NOT NULL PRIMARY KEY, [ManifestId] Integer NOT NULL, [VendorId] Integer NOT NULL, [ProNumber] Varchar (15) NULL, [PurchaseOrder] Varchar (20) NULL, [Route] Varchar (20) NULL, [Cartons] Float NULL, [Weight] Integer NULL, [PickupDate] Smalldatetime DEFAULT getdate() NOT NULL) Create table [Manifests] ( [Id] Integer IDENTITY (1, 1) NOT NULL PRIMARY KEY, [CarrierId] Integer NOT NULL, [ManifestNumber] Varchar (10) NULL, [ManifestName] Varchar (25) NULL, [TrailerNumber] Varchar (15) NULL, [SealNumber1] Varchar (15) NULL, [SealNumber2] Varchar (15) NULL, [CreateDate] Smalldatetime DEFAULT getdate() NULL, [EShipNumber] Integer NULL, [Closed] Bit NULL DEFAULT 0) Create table [Vendors] ( [Id] Integer IDENTITY (2001, 1) NOT NULL PRIMARY KEY, [Name] Varchar (50) NULL, [Addr1] Varchar (50) NULL, [Addr2] Varchar (30) NULL, [City] Varchar (30) NULL, [State] Char (2) NULL, [Zip] Varchar (10) NULL, [Contact] Varchar (30) NULL, [Telephone] Varchar (15) NULL, [IsDeleted] Bit NOT NULL DEFAULT 0) I want to know who get a Manifest, with both the CarrierID and the Carrier.Name, with all the Detail Records for the retrieved Manifest, with both the VendorID and Vendor.Name. Any help would be greatly appreciated.
RW Bradley |
|
|
The simplest approach would be to mark these associations (Manifest to Carrier, Manifest to Details and Detail to Vendor) as EagerLoad. If you do this, then when you load a Manifest, the Carrier, all the Details, and the Vendor for each Detail will be automatically loaded in the same SQL query. This is a little inefficient because it loads all the Carrier and Vendor data, even though you only want the IDs and names. Whether this inefficiency matters in your case will depend on how many records you are retrieving. You can get around it by using a named aggregate to lazy-load the unwanted fields (see "Querying" in the help file), though some care is required if you normally want these fields to be eager-loaded. |
|
|
Worked - I got everything working. Thanks for your help - great product.
|
|