mapping

Keeping nhibernate fluent mapping in sync with the database

We are currently using Fluent NHibernate and SQL Server 2008 in our c# development, however, the database schema has become too complex for Fluent to re-create the database when necessary so we are making changes to the database using scripts. This also means that the entity and mapping classes also need to be changed to remain in sync ...

Lazy load nhibernate one-to-one

Hi I have a true one to one mapping. But I would like to use lazy loading(load on demand). I have Class Person with a association with Class Address. The mapping looks like this.. PERSON <one-to-one name="address" class="Person" cascade="all-delete-orphan" access="field"> ADDRESS <class name="Address" table="Address" lazy="true"> ...

adding a map overlay on a UK Ordnance Survey OpenSpace map

Does anyone have a code example of how to add an image overlay to an Ordnance Survey OpenSpace map? The documentation is not exactly comprehensive :) Thanks! ...

Determining the projection in a given map

I realise this is potentially not a programming question, however its a problem I keep bumping into as a programmer, so I figure others here might have useful knowledge to share. I have a map of a region of the earth (it could be any, but here's an example) how should I determine the projection used in the map and then how should I prog...

How can I use a Collada (dae file) for environment mapping?

Where can I find documentation and/or an example of how to use environment mapping in a .dae file viewable by either the included Collada viewer (viewer-d.exe) or the RenderMoney viewer (osgviewer.exe)? ...

Many-to-many on the same table with additional columns

I have a class User. A user can be a friend with many other users. The relationship is mutual. If A is a friend of B then B is a friend of A. Also I want every relation to store additional data - for example the date when two users became friends. So this is a many-to-many relationship on the same table with additional columns. I know th...

IIS 6: client certs renewal of already 1:1 mapped client certs

hi, if a client certificate which is used for mapping in iis6 is renewed. do then i have to renew the mapping (one to one mapping!) also?!?! at least it looks so! why this? the public key is same as in the expired cert! i would assume/think that iis 6 is using the public key for mapping! can someone confirm or clarify, please! thanks in ...

TFS build-server build of branch?

We have a TFS 2008 project with two branches ("Main" and "NewFeature"). Each is a complete, independent "copy" (variant) of the source code. By changing the workspace mappings, we can map either variant onto our local PCs and have been working with both branches with no problems. However, if I set up the mappings to switch our build se...

nhibernate: how to map two tables to a single non-persistent class?

I have two similar tables: Table1: [ id ] | [ name ] Table2: [ id ] | [ name ] and I need to read/write data using only one class: public class TwinTable { public virtual int Id { get; set; } public virtual string Name1 { get; set; } public virtual string Name2 { get; set; } } Plus one of the tables may or may not have...

How to map a Entity Data Model conceptual model property to a storage model column using the "Serialized LOB" pattern?

I have a conceptual model in EDM where one of the entities has a property which is essentially a big value object whose properties aren't really useful as columns in the datamodel. I'd like to apply the Serialized LOB pattern to it so that I can fit it into a 192 byte binary column. How do I map this in the EDM v4? Is it even possible a...

Splitting one DB association into several collections in Hibernate.

I am trying to model such situation - there is a cash transfer (I mean a car that carries money), that has required amounts of each currency, and also an actual amount for each currency. And it seems to me pointless to create two separate classes, one for required amount and another for actual amount. So the implementation would look lik...

Join tables with additional fields

We started with a fairly standard relationship between a Project entity and a ProjectStatus entity via a join table. The class declarations (with annotations) look like this. @Entity @Table(name="PROJECT") public class Project { @Id @Column(name = "PROJECT_ID") private Long id; @ManyToOne(fetch=FetchType.EAGER, cascad...

Hibernate mapping

I got a table with a PK and a value "country", all my labels are definied in another table which has composite-ids. Does anyone has an example for me how I can map my country value to the correct label in the other table? mappings are bound on PK, if I'm not wrong. <class name="hibernate.P1" table="P1"> <id name="id" type="int...

Mapping from Entity Framework to custom domain model classes?

I wonder how could I obtain an automatic mapping between entities generated by entity framework (.NET Framework 3.5 SP1) and custom domain model classes? I know I can create some data converters that translates the objects back and forth between the two worlds, but how could I accomplish this in an automatic way? I started to develop my...

Storing Python dictionary entries in the order they are pushed

Fellows: A Python dictionary is stored in no particular order (mappings have no order), e.g., >>> myDict = {'first':'uno','second':'dos','third':'tres'} myDict = {'first':'uno','second':'dos','third':'tres'} >>> myDict myDict {'second': 'dos', 'third': 'tres', 'first': 'uno'} While it is possible to retrieve a sorted list or tuple fr...

Altova MapForce - maxLength of element content validation

Hi guys I've mapped one XSD schema to another one using Altova MapForce and generated Java classes from it. So far so good, Java works nice. However I've noticed that the mapper is not validating the maximum length of strings in input XML. For example we have an element which is a type of String with following constraint : <xsd:rest...

How to map this legacy table with NHibernate (Fluent)?

New to NHibernate. Having trouble wrapping my head around how to map this legacy table. CREATE TABLE [dbo].[CmnAddress]( [addressId] [int] NOT NULL, [objectType] [varchar](63) NULL, [objectId] [int] NULL, [addressType] [varchar](7) NULL, [recordStatus] [char](1) NULL, [fromDate] [int] NULL, [toDate] [int] NULL, [onStreet] [varchar](254...

Rendering a point light using 6 spot lights?

I'm trying to render 6 spot lights to create a point light for a shadow mapping algorithm. I'm not sure if I'm doing this right, I've more or less followed the instructions here when setting up my view and projection matrices but the end result looks like this: White areas are parts which are covered by one of the 6 shadow maps, the...

PHP - generating a world map from border data

I have found the shape data for the borders of all the countries and a class to process it and I have written a script to convert the longitude and latitude to a pixel location on an image and to draw the countries using imagefilledpolygon and imageline. Everything is working great except: 1) I have a $scale variable that I can change. ...

How to map EditModel to Command Messages?

Jimmy Bogard at Los Techies says that he maps his EditModel to Command Messages instead of mapping EditModel to DomainModel. Can anyone explain this further? ...