mapping

How to Map oracle datatype SYS.XMLTYPE in Nhiberbate

Hi, I have a table in oracle having column of datatType SYS.XMLTYPE and have to map it in Nhibernate hbm to retrieve the XML. I am using C# with .net framework 3.5 is there any specific dataType available to map this or can i use byte[] or char[] for mapping? Thanks Arvind ...

Entity Framework Multiple Table Entity Key Mapping issue

Ok so here is my issue. I have a QA day log table and a Employee table. I want the NetUserID on the Employee table to be transfered to the QA day log table. I added both tables, cut and pasted in the designer and I edited the mappings like I thought I was supposed to. I get an error about the DL_ID which is the primary key for the QA...

Mapping to an element of an array

I have a class Parent wich contains an array of 3 Child class objects (Child[] ChildArray). I have a Database Table MyTable with fields [FLD_01], [FLD_02], [FLD_03]. How do I map [FLD_01] to ChildArray[0], [FLD_02] to ChildArray[1] etc? ...

British National Grid Shapefile - convert to WGS84 Lat/Lon

I have a set of ESRI shapefiles which, I'm told, have been written using the British National Grid coordinate system. I need to convert these files to WGS84 lat/lons, for onward conversion to KML files. I'm having trouble doing this as follows: If I open each of the original files in MapInfo Professional telling it that my file has a pr...

NHibernate base and derived class mapping

Situation: I have a class MyClass and its "lightweight" version MyClassLite, so i have public class MyClass : MyClassLite I also use hbm file for mapping my classes (they are mapped to the same table). The thing is that when i try to get a list of MyClassLite entities, i get not only MyClassLite entities, but a list of MyClass entitie...

Hibernate Immutable Value Object

customer = // get customer from the current hibernate session // customer has a discount with database id of 1 Everything is fine until here. But if I call: discount = SpecialDiscount.create("10%"); customer.setDiscountTo(discount); session.save(customer); // customer has a discount with database id of 2 now How hibernate can updat...

Entity key of a view as navigation property

I have a table CREATE TABLE Tasks (   ID INT IDENTITY(1,1) NOT NULL CONSTRAINT PRIMARY KEY PkTasks,   ...other fields... ) and a view CREATE VIEW VTaskInfo AS SELECT   T.ID IDTask,   ...other fields... FROM   Tasks T How can I create navigation property connecting 'Task' and 'VTaskoInfo' entities? Usually defining navigation pr...

Calculate Y position from latitude in degrees on mercator projection

Hi, I'm trying to calculate the Y position on a map with mercator projection given the latitude in degrees. Here's what I need: //mapHeight might be 600 (pixels), for example //latitudeInDegrees ranges from -90 to 90 public double CalculateY(double mapHeight, double latitudeInDegrees) { //what on earth do I do here to calculate the...

fluentnhibernate and virtual entities

Why fluentnhibernate (v. 1.0) when you map the entities (not using automap), all must be virtual, even those that are not mapped? There is a way not to set props / methods virtual ? Mic. ...

Creating custom Google (or OpenLayers?) maps

Hi all, I'm currently working on a project which maps items to a physical location within a building. We have a map created in our GIS system (ArcGIS), and are able to resolve items to the appropriate shape ID on this map. We want to create a web map using one of the APIs such as Google maps or Open Layers in order to display this info...

Open source (free) Object mapping software for .Net

We're needing to map between one object and another, i.e. obj1.property1 needs to map to obj2.property3 and obj1.property2 needs to map to obj.property1, etc. I know there are open source frameworks for Java like Dozer. Are there any .Net ones out there? ...

Qt Map Signals Based On Parameter Value

Hi folks, I know that i can use QSignalMapper to call a slot with different parameters based on connection. What i want to achieve is a little different. We are using plugins in our application and different plugins are responsible for different types of objects. We are connecting multiple slots, each implemented in a different plugin,...

Automapper - Nested entities

I'm updating or creating an entity that has a child relationship, say the aggregate root is Product (ProductId, Title) which has zero or more ProductSuppliers (ProductSupplierId, SuppliedAtPrice, SupplierInfoId), and the DTO represents a similar structure (all the info). Simple enough. I've created a simple map for ProductDTO and Produc...

Fluent nHhibernate gets but fails to save with 'HasManyToMany'

I have a Resource entity which has a many-to-many relationship with a File entity, such that a resource can reference multiple files and a file can reference multiple resources. Now I expect the save to cascade down from the Resource to the File entities when the Resource is Saved - When I load a Resource entity it is loading the File e...

Fluent NHibernate: mapping one-to-one

NHibernate seems to support a special case of one to one mapping (That doesn't require a 1-m mapping on each side of the relationship). See this article by Ayende: http://nhforge.org/blogs/nhibernate/archive/2009/04/19/nhibernate-mapping-lt-one-to-one-gt.aspx I have no idea how to specify this in Fluent NHibernate though - is this pos...

Fluent NHibernate: rarely used properties as Component, or in seperate table?

Hi, I wonder if you could help me with something I've been thinking about. Say we have an Entity. Say the endtity has an ExtendedInfo object, which contains various properties which are not often used. I'm wondering how best to structure this for FNH. The easiest thing to do I suppose would just set the UserInfo up as a Fluent Nhibe...

Mapping integers to booleans in Objective-C

In Objective-C I need to associate a mutable collection integers (monotonic, non-contiguous, could get fairly large) to boolean values. The obvious way is just to have an NSDictionary w/ NSNumbers as keys and values. Is there a better way that doesn't involve so much object creation? I'm really not trying to pre-optimize so much as lea...

NHIBERNATE: How to map a collection into the DB using Mapping.Attributes

I Have this Product Class i took from the examples of how to use nhibernate (but i did some modifications to it) I want to be able to map a class and all of it's references into the DB. [NHibernate.Mapping.Attributes.Class(Lazy=true)] public class Product { [NHibernate.Mapping.Attributes.Id(Name="Id",TypeTyp...

NHibernate nested class mapping problem

I have below classes. How can I write mapping document for MainBranch.Id column. I have no branch table in database, just want to use branchId for MAINBRANCHCODE. Any Idea? public class Bundle { public virtual Decimal Id { get; set; } public virtual BundleEntranceInformation Information { get; se...

nhibernate 'virtual' fields

I want to have a 'virtual' (not there, not to be confused with the virtual keyword) field in a nhibernate class. I have a securities table and I want to have a 'virtual' field that uses another field to return a flag. I have added a calculated field in the db_securities table nhibernate class: public class DB_Securities { ...