mapping

Are all NHibernate References LazyLoaded by default?

I have a (fictional) class with Fluent-mapping: public class Customer { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual Employee Responsible { get; set; } public virtual IList<Order> Orders { get; set; } } public class CustomerMapping : ClassMap<Customer { public Cus...

Modelling a triple-join column in Hibernate an alternative way

Hi! I have a problem with mapping a triple join table as a map with Hibernate using annotations. I have 3 tables: project, group, role and triple join table project_group_role with columns project_id, group_id, role_id (the primary key is a pair of project_id and group_id). Database structure is given strictly from supervisor, so I'd rat...

Hibernate not populate data from mapping table

I have User class and Country class with respective tables. Country table data is fixed. I make a mapping table User_Country(userid, countryid) and following mapping in User class @OneToMany(fetch=FetchType.EAGER) @JoinTable(name = "User_Country", joinColumns ={ @JoinColumn(name = "userid") }, inverseJoinColumns...

db access via interactive tags map

I want to create an interactive tags map, kinda like 'visual thesaurus' (http://www.visualthesaurus.com/), and use it as an a access portal to my DB (display tagged data in a separate area), what do you think would be the best technology to use? I need something that would be SEO friendly of course, easy to use (user wise), and easy to ...

Hibernate Mapping of nested collection in java to mapping table through java annotation?

Problem too specific.closing the same. ...

Ideal database for geo (map) data

I'm looking for suggestions for an ideal database or data structure for storing a map. Essentially, the map consists of "ways" which are like roads, paths, etc. Ways contain nodes (which have a latitude and longitude coordinate, and sometimes an altitude.) Any such database or structure: should be able to locate all the nodes in a bo...

How to map a tuple of data to a tuple of functions?

I have the following Python code: data = ['1', '4.6', 'txt'] funcs = [int, float, str] How to call every function with data in corresponding index as an argument to the function? Now I'm using the code: result = [] for i, func in enumerate(funcs): result.append(func(data[i])) map(funcs, data) don't work with tuple of function...

How to persist a @OneToMany update with hibernate ?

Hi, in my application I've got users which have files. The UserVO has the following mapping: @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "users") public Set<Files> getFiles() { return this.files; } Then I have a HibernateDAO with the following update method: public void update(T vo) { try { ...

Dozer - mapping problem

We have two beans Source and Destination with the same properties : private Map<String,List<Tarif>> tarifBySegmentAndByPassenger = new HashMap<String, List<Tarif>>(); Every works "fine" except in the Destination bean, all the Tarif object has been replaced by something like this : com.mypackage.Tarif@2453 Dozer seems to do a toS...

How to integrate Yahoo static map in ASP.Net website

How to display yahoo static map in ASP.Net gridview control? The address for loading the map will be present in one of the columns of gridview and based on the address of each row the static map has to be displayed on each row. ...

using fluent-nhibernate, is there convention to make the foreign-key column in one-to-many relation not null ?

I'm using fluent-nhibernate conventions to map my entityies: public class HasManyConvention : IHasManyConvention { public void Apply(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance) { instance.Key.Column(instance.EntityType.Name + "ID"); instance.Cascade.AllDelete...

NHibernate one-to-one mapping, non-primary keys

Can't get NHibernate to generate the correct query. It keeps using the primary keys of the two tables I'm joining for the one-to-one relationship, and I can't figure out how to specify the foreign key in one of the tables. tableA tableB { aID, { bID, bID, z, c, y, d } x } so the tableA should jo...

linq to entities mapping

Hi, I got an error with mapping. I got a column in the database that has the data type image, because i need a byte[] image was the best option. So i changed that from string to byte[]. But now i get an error about mapping. I already changed the type string in the dropdownmenu properties of the column to 'byte'. That didn't help. How ...

NHibernate: Composite key many-to-one mapping: Can't resolve property (foreign key component)

Hi guys, I hope anyone can help. I have to develop up against this third party database and I am kind of stuck with their crappy design. Still, I want to use NHibernate so I will have to jump through hoops. Simplified, there is this "Event" table that has a relation a "Transportation" table. The transportation table has a composite p...

Getting both JSONObject and Google Gson feature in a single library

I was wondering, is there any JSON library which enable me Get a key to value map, out from JSON String (JSONObject able to do this) Get a Java object, out from JSON String (Google Gson able to do this) The following both print value package jsontest; import com.google.gson.Gson; import org.json.JSONException; import org.json.JSONO...

C++ Representing a 3D array in a 1D array

I want to store the byte value of aFloat in pixelsArray for each 3D coordinate, in a 1D array: float aFloat = 1.0; unsigned char* pixelsArray = new unsigned char[HEIGHT*WIDTH*3]; for (int i = 0; i < HEIGHT; i++) { for (int j = 0; j < WIDTH; j++) { for (int k = 0; k < 3; k++) { pixelsArray[?] = aFloat; }...

Compositing Android MapView and SurfaceView

I have an application with a SurfaceView and a MapView. They are displayed in a single view, like so: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainlayout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <co...

object-relational mapping

Hi, I need to store an instance of an complex datatype into a relational database. Is there a way to do this without moddeling the database structure first, like it is done in ado.net? The database (or table) structure should be created from the class structure. The class has some properties like ints, strings or bools but could also ha...

How to map poco to JSON using Automapper

In my MVC 2 application I have a typical method that calls a web service, builds a JSON data object and returns it to the view. Everything works fine, but I was wondering if there is a way to do the mapping with Automapper so I can remove the ugly code from my controller. Thanks in advance Here is my Action method public virtual Actio...

Geolocation on an image-based map - data collection and data structure best practices.

My goal is to be able to open a web page on a mobile browser and, provided you are within the geographical bounds of the mapping area, plot your location on a stylized map image (PNG, JPG, whatever). Also on this map will be points of interest, and it would be nice to say "You're closest to XZY thing". Is it sufficient to gather individ...