mapping

Constrained Sequence to Index Mapping

I'm puzzling over how to map a set of sequences to consecutive integers. All the sequences follow this rule: A_0 = 1 A_n >= 1 A_n <= max(A_0 .. A_n-1) + 1 I'm looking for a solution that will be able to, given such a sequence, compute a integer for doing a lookup into a table and given an index into the table, generate the sequence. ...

Is there a tool that can visually map table relationships in MySQL?

I'm looking for a tool that can map the relationships in my database in mysql. I would like something like the view that is generated in MS-SQL Server Management Studio in the 'Show Diagram Pane'. Does such a thing exist? I'm in charge of the design of the database and its using rails conventions. I would not be adverse to specifying...

How to map different Java-Bean structures onto one another

In our project we have to map one nested structures of beans onto another. (These are actually JAXB mapped Java-Representations of XML documents that, say, represent an incoming order document.) This has to be mapped onto the quite different order document structure of another system. What are the options to do this? I would prefer some...

Map API/Layer that may be used in pages requiring login.

I'm developing an application with a feature that allows users to mark places on a map (events, locations etc.). I'm not allowed to use the basic google maps api because it requires pages that implement the maps to be publicly available. Does anyone know of any alternative with rich layers (including Europe, Asia, etc.) that can be used ...

How to map many-to-many List in Hibernate with a Link Table

I would like to map a many-to-many in Hibernate using a link table. I have two classes, Parent and Child class, for example: public class Parent{ private List<Child> _children; //...getters and setters } I use a link table (link_table) with three columns link_id, parent_id, and child_id. The database is SQL server and id types are u...

NHibernate: Best way to map to DateTime a value stored in a non-standard way

I am just getting started with NHibernate (for the 15th time it would seem) and am having the following problem. The following table: Table Facility Column FACILITY_ID integer Column NAME varchar2(50) Column MONTH varchar2(5) For whatever reason, month is a string instead of a native Date type and looks like this: "200811" represent...

fluent nHibernate mapping

I am working on a legacy system and have introduced fluent nHibernate but have one last mapping that I can not seem to get working. Code: public class Permit { public int PermitId { get; set; } public char Discipline { get; set; } public PermitDetails PermitDetails { get; set; } } public PermitDetails { pub...

A Proper One-to-One Mapping Table

I want to make a table that simply has two integer columns to serve as a mapping table between two different data sets and I wish to put the correct constraints on it. I initially set the two columns as a compound primary key, but then realized that represents a many to many, only keeping duplicate many to many mappings from occurring. ...

What algorithms compute directions from point A to point B on a map?

How do map providers (such as Google or Yahoo! Maps) suggest directions? I mean, they probably have real-world data in some form, certainly including distances but also perhaps things like driving speeds, presence of sidewalks, train schedules, etc. But suppose the data were in a simpler format, say a very large directed graph with edg...

How to map a domain to another domain's subfolder?

I have a very fast web server (IIS6, ASP.NET) that I want to use for several sites. Now, I already have a domain that maps directly to the IP address of the server, but how can I get another domain to map to a subfolder (i.e., a separate ASP.NET application) on that same computer? Is it theoretically possible? (note: only port 80 is open...

How to do custom-query based collection mappings in Hibernate?

I have an object that is mapped to have a set of objects, very simple. However, what I really want to do is put some criteria on that mapping. Here's the current mapping: <set name="ops" inverse="true" cascade="all, delete-orphan"> <key column="cityblock_id" on-delete="cascade"/> <one-to-many class="com.tamedtornado....

How can we execute custom method while Cascade="Delete" is being executed ?

For example i have two entities. "RealEstate" and "Picture". RealEstate holds a collection of Picture. In the mapping file RealEstate has a bag in it for Pictures and cascade is Delete". If you delete a RealEstate all the related Pictures will be deleted. But is there any way to execute a custom method to delete the pictures from the we...

Can I use SPACE as mapleader in VIM?

Hello, From http://items.sjbach.com/319/configuring-vim-right I got that you were supposed to be able to use SPACE as the mapleader in vim. I've tried but it does not seem to work. Anyone who have made it work? Tried: let mapleader = <space> Thanks, -Martin ...

Powerful .NET Map APIs?

A coworker of mine thought of a great way to visualize a lot of the data we work with in our user-end applications, but we're not aware of many available sdk's or apis that hook in. We're trying to recreate in essence, the "Magic-Wall" of CNN. We would like to be able to show trends across the country in a 'heat-map' kind of way, and be...

Data Exchange Design Proposal

Basically the situation we have is we need to be able to take data from an arbitrary data source (database, flat file, it could be anything really), morph the data so it maps to the schema we have, and then send us the data so we can store it. The data will be coming from ~200 different physical locations around the country and we'd lik...

How do I create a NHibernate Mapping file for a multi-value component that is a Unique set of columns?

I'm using Nhibernate and fluent nhibernate to create a mapping file for a domain object (though I don't care if an answer uses fluent nhibernate or xml hbm syntax). And I'm having trouble with figuring out how I specify that a set of columns representing a component within the domain object is unique. Here's the domain object: public ...

Python reverse / inverse a mapping

Given a dictionary likeso: map = { 'a': 1, 'b':2 } How can one invert this map to get: inv_map = { 1: 'a', 2: 'b' } ...

Hibernate change fetch mode in runtime

Hi there. I have two tables related together using one-to-many relation : employee -> department : and relation through department_id in the employee table. I use hibernate : and my hibernate mapping files are: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" ...

Copy Files quickly from a mapped network drive

Hi, Can anyone tell me how to quickly copy Files from a mapped network drive? The windows Copy Paste works very slow and hampers the performance of the system. I have used XCOPY source destination /i /s /z /q This was quick enough and copied a few files and later threw an error "The specified network name not available" I remember ...

Mapping a bidirectional list with Hibernate

I don't understand the behavior of Hibernate when mapping a bidirectional list. The SQL statements that Hibernate produces seem not optimal to me. Can somebody enlighten me? The scenario is the following: I have a one-to-many parent-child relationship. I map this relationship with a bidirectional list. According to the Hibernate Annota...