mapping

Relationship Mapping in EF4 code-only CTP (when using inheritance?)

Hi Everyone, I'm producing a simple composite patterned entity model using EF4 w/ the code-first CTP feature: public abstract partial class CacheEntity { [Key]public string Hash { get; set; } public string Creator { get; set; } public int EntityType { get; set; } public string Name { get; set; } public string Predec...

Multiple Linq data models with the same table being mapped in each Re-use mapping

I've implemented the repository pattern on the data access layer of our current service layer. We have an object model where the same class "historical notes" is mapped on mutiple objects (currently 6 but soon to be more!) Part of the best practices for the use of linq to sql is not to have one dbml file for every table in the db, but ...

Manipulating maps.

Given a set of floorplans (in Autocad, svg, or whatever format need be...), I would like to programatically generate directions from point A to point B. Basically I would like to say: "How do I get from room 101 to room 143?" (or for triple bonus points, from room 101 to room 323). Anyone have any ideas how to go about this? I am pre...

Fluent Nhibernate - Mapping a list results in NullReferenceException?

I have the following classes and fluent mappings: public class A { public virtual int Id { get; private set; } public virtual string MyString { get; set; } public virtual IList<B> MyChildren { get; set; } } public class B { public virtual int Id { get; private set; } public virtual DateTime TheDate { get; set; ...

Mapping Map<String,Foo> in Hibernate

Hi all, I'm trying to map my Hashmap in Hibernate. All examples I can find are simply like this: class FooBar{ Map<String,String> myStrings; } Which would simply map to <map role="ages"> <key column="id"/> <index column="name" type="string"/> <element column="age" type="string"/> </map> However, I use a more object-oriented ...

Loading Entity from different table in EF4

Lets say I have two entities in my EF model Customer and Address which map to their respective Customer and Address tables in the db. What I'd like to do is load up a Customer and their Address from the db into these entities but from different tables with slightly different schemas. They will then be saved to the Customer and Address ...

Mappings between Data Models in n-Tier Systems !

Greetings Overflowers, I'm really tiered of over-thinking this subject Here are typical mappings: Relation DB Model <> Server OO Model <> Serialized Model <> Client OO Model <> stands for bi-directional mapping I'm currently using Java for my backend and ExtJS (JavaScript library) for my frontend. It makes sense to serialize to/from...

Proper Hibernate id generator for postgres serial/bigserial column?

My PostgreSQL tables have id's of type bigserial, meaning they are generated at the time rows are inserted (and thus, the id column's value is not supplied in the INSERT statement). I'm having difficulty finding the proper value for the <generator class="..."> attribute in my XML mapping file. The code below is the closest I've found t...

Map a NativeQuery into an entity

Hello everyone, I'm having trouble trying to map a native SQL query using JPA, and Hibernate as a provider. This is the code for the entity that I'm using for this purpose: package com.prueba.entities; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EntityResult; import javax.persistence.Field...

What benefit is there of allowing a variable to be left uninitialized?

In many languages you're allowed to declare a variable and use it before initializing it. For example, in C++, you can write a snippet such as: int x; cout << x; This would of course return unpredictable (well, unless you knew how your program was mapping out memory) results, but my question is, why is this behavior allowed by compil...

One to one relationship mapping with composite key

Hi everybody, I have a database like this: My question is "How to mapping this database using castle active record?" I've tried this code: Campaign: [ActiveRecord("[Campaign]")] public class Campaign : ActiveRecordBase<Campaign> { private long m_ID; [PrimaryKey(Column = "`ID`")] public long ID {...

android route mapping program

hai , Can anybody help me to create a route mapping program in android which will take location's names as input and give output as route between these two locations ...

Can I customize JAXB @XmlElementWrapper elements for a java.util.Map

Hi, I'm trying to learn to use Map with Jaxb. I did this: @XmlElementWrapper(name = "phoneNumbers", nillable = true) private Map<String, PhoneNumber> phoneNumbers; and the result was: <xs:element nillable="true" name="phoneNumbers"> <xs:complexType> <xs:sequence> <xs:element name="entry" minOccurs="0" maxOccurs="un...

Hibernate Mapping problem with unrelated collection

Welcome, I've some problem with Hibernate mapping. Database structure: TableA -ID_A --PK TableB -ID_B --PK -ID_A -- FK -> TableA TableC -ID_C -- PK -ID_A -- FK -> TableA POJO structure: class TableA extends Pojo { /*Some Fields*/ } class TableB extends Pojo { TableA tableA; /*Some properties*/ } class TableC ex...

Mapping for multi-interface-inherited class in NHibernate.

I have interface: public interface IHasList<T> { IList<T> Items { get; set; } } And I want to map such class using one-to-many mapping to the lists: public class Model : IHasList<A>, IHasList<B> { ... } Can I do this? If yes, how to write mapping? ...

using only annotated mappings

Hello, I'm having some problems removing mappings from my dispatcher-servlet.xml file. I've annotated some controllers with @RequestMapping, am using spring 3.0.3, and have all the correct includes. Shouldn't this work? ...

Convert lat / lon to pixel locations

I've got a map (Mercator), and the coordinates of the 4 corners of the map. I need to come up with something so I can convert given coordinates to corresponding points on the map. I can't use google or anything of the sort, which is why I'm needing to do this in the first place. The languages I can use are either going to be PHP or ...

Saving manually created objects using NHibernate

Hi, I am trying to use NHibernate to save an object that was completely manually created. My mappings are in place and I currently have no data in the database. Everytime I call Save() or SaveOrUpdate(), NHibernate does a select statement for what I am trying to save. Then it gives me the exception: "a different object with the same ...

Is it possible to map collections of primitive types with EF4?

Is there a way to map a collection/dictionary of primitive types in Entity Framework. I would like to have: public class Abc { public virtual long Id {get;set;} public virtual ... some properties public virtual IList<float> Numbers; // or even: public virtual IDictionary<DateTime,decimal> MoreNumbers; ...

Fuent NHIbernate two mappings on the same table, no discriminator

Hi all, I have a table that references many items. In the general view, I don't want to load all these references, for obvious performance reasons, but in the global view, I would like to load the same table, with all the references. I tried making two classes mapped on the same table, but it loads the two classes when loading the table...