Home » Blog

rounded header

New features in the LightSpeed designer

tag icon Tagged as LightSpeed

We’ve been adding a few features into the LightSpeed designer recently. Here’s a quick rollup of what’s new.

Reorganising inheritance hierarchies

One of the problems with mapping between the object and relational worlds is handling inheritance. In the LightSpeed designer, if you do database-first design but want to use inheritance in your domain model, you’ll run into this problem when you drag tables onto the model (or update the model) and find properties appearing in the “wrong” place.

  • In single table inheritance, properties that are meaningful only on a derived class appear on the base class because the columns are on the common table, so LightSpeed has no way of knowing where else to put them.
  • In concrete table inheritance, properties that appear in multiple tables appear in multiple leaf classes, when you may want to consolidate them in the base class.

We’ve now added a couple of commands to the designer to help with these situations by automatically moving properties down into a derived class or up into a base class. This saves you having to delete and recreate the properties, and reduces the chance of making a mistake if the property has additional attributes such as Column Name or validations. To use these commands, just right-click the property you want to move and choose Move to Derived Class or Move to Base Class from the menu.

Through associations

You can now model through associations (LightSpeed’s implementation of many-to-many associations) in the designer. Just drag a Through Association arrow between the two end types.

If your through entity has no properties of its own, and you don’t need to override its default behaviour or attributes, you can then hide the through entity by right-clicking the through association arrow and choosing Convert to Auto Through Entity.

Value object database synchronisation

In the past, if you’ve had an entity with value object properties, that entity has been excluded from database synchronisation operations (Update From Source and Update Database). This limitation is now removed. You won’t get full Update From Source functionality because it’s not possible to safely modify the properties of the value object type (because that could affect other tables, putting them out of sync), but for model-first development this should be very handy.

CRUD stored procedure support

You can use the CrudProcedureAttribute to tell LightSpeed to use stored procedures instead of table access for select, update, insert and delete operations. This is now also supported in the designer. Select the entity and change its Access Method to StoredProcedures. New entries appear in the Properties box for the names of the Select Procedure, Select By Id Procedure, etc.

In addition, entities whose Access Method is anything other than Table are now excluded from synchronisation, so you will no longer need to exclude these entities manually each time you update.

We’ve also fixed a couple of bugs and minor limitations.

If you’re using the designer and any of these features sound useful to you, grab the latest nightly build (free Express Edition here, retail editions from the store) and check it out!

5 Responses to “New features in the LightSpeed designer”

  1. Hi Ivan,

    Quick question on the “CRUD stored procedure support” – can you only supply an update/insert stored proc but not a select proc?

    E.g. If no select proc is supplied the default ‘select fields from table’ will be used and when you update and there is an update proc you will use it?

  2. At present CRUD stored procedures are all-or-nothing, i.e. if you want to use a sproc for update or insert, you have to use sprocs for select and delete as well. We would be very happy to take a look at removing this limitation for you if you have an immediate need — let us know!

  3. I need this. As I am using SQL SERVER 2000 that is not supported by lightspeed and therefore I have to do an insert stored procedure. However, I’d still like the select to be working as per default.

    Also, the generated code generates something like:
    var valueToReturn = Execute(procedureQuery)

    Then, I get an error to say “The name ‘Execute’ does not exist in the current context’.

    Any idea?

  4. LightSpeed does support SQL Server 2000: there are some limitations around paging etc., but you can certainly do an insert without needing a sproc.

    The error on Execute may mean that you are building against the Client Profile, or against an old version of LightSpeed (which might also explain why you’re not seeing a SQL Server 2000 option). Hard to be sure without further info. Please raise an issue in the forums if you need us to investigate further — but as I mentioned above you shouldn’t actually need the sproc.

  5. Oops, sorry, just saw you already did raise an issue in the forums!

Leave a Reply

Data Products Visual Controls Community Store
LightSpeed ORM
NHibernate Designer
SimpleDB Tools
SharePoint Tools
WPF Elements
WPF Diagrams
Silverlight Elements
Forums
Blog
Register
Login
Subscribe to newsletter
Buy Now
My Account
Volume Discounts
Purchase Orders
Contact Us