mapping

How to find mappings of attribute in Dozer at runtime?

I use Dozer to map between Java beans. I have a dozer mapping file with all the mappings present in it. A sample mapping is shown below: <mapping> <class-a>com.xyz.A</class-a> <class-b>com.xyz.B</class-b> <field> <a>key</a> <b>id</b> </field> <field> <a>actionId</a> <b>action</b> <...

Class Mapping Error: 'T' must be a non-abstract type with a public parameterless constructor

Hi, While mapping class i am getting error 'T' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method. Below is my SqlReaderBase Class public abstract class SqlReaderBase<T> : ConnectionProvider { #region Abstract Methods protected a...

Is it possible to make a non-nullable column nullable when used in a view? (sql server)

Hi, To start off I have two tables, PersonNames and PersonNameVariations. When a name is searched, it finds the closest name to one of the ones available in PersonNames and records it in the PersonNameVariations table if it's not already in there. I am using a stored proc to search the PersonNames for a passed in PersonNameVariationand...

many-to-many join table discriminator?

Hi all, I'm trying to link a Communication object I've created that has 2 properties "SuccessRecipientList" and "FailRecipientList" to a Users object, via joining table "Communication_Recipients". I'd like to do this using a discriminator on the joining table instead of creating an actual domain object for it (Using the HasFailed Bit co...

image map software for coordinates using magic wand

Quick question... there are lots of ways to create an image map (old school, I know!) for a web page, but I have a requirement for one. I want to have an interactive map showing UK counties. I have the map, I have "mapspinner" (also dreamweaver) to do the polymap... but, I was wondering if there was a way to use a magic wand to get the...

Mercator Projection and scaling

http://wiki.openstreetmap.org/wiki/Mercator With the C# example in the above link, I am able to project lat/lon to x/y co-ordinates. However, I'm having problem with scaling. I wonder how much length (in miles?) each pixel have after projection. I would like to scale the map before rendering as 500 pixels per mile or something like that...

vim remapping the hjkl

I am trying to map the letter hjkl to jkl; in my .vimrc file so that i can have my fingers the way they always are on the keyboard, while writing in vim. the problem is that as i map k to l, it jumps into the l to ;. so k becomes the same as ;. the same off course happens to all of them. so all the keys become one because they copy thr...

XML mapping and validation for Rails models

I am implementing an application that manipulate XML documents using Ruby on Rails. I want to have models that encapsulate all the logic and then convert them to corresponding XML document when save. Although I do not need database persistence for my models, I want my models to have validation mechanism like ActiveRecord's. Also, for con...

Use hbm2ddl to generate SQL DDL for database schema update (without losing data)

I have been using hbm2ddl and hbm2java to build my database and POJOs for my project based on my XML mapping files (hbm.xml). I'm starting to get some real data now in the system, so re-running my ant script which drops the database and recreates everything is no longer a viable option since I want to keep the data. I have heard that the...

WPF Image Mapping

Is there a way to draw/fit a simple Quadrilateral cut-out from an image onto a standard axis-aligned rectangle for screen display. (So that the cut-out will be distorted to fill the rectangle points). Seems to me it should be possible with an ImageBrush but I cannot quite see it. ...

Vim mapping ctrl-k

I use k to move cursor line down in a file. but i want to add that when i press ctrl-k, to move 7 lines down in a file. i have put this in my .vimrc file: nmap <c-k> 7k but what that does is move 7 lines down and then enter a spacebar. how do i stop it from entering the spacebar? ...

vim mapping ctrl-;

In my case the move-right button is ; I want ctrl-; to move the cursor 7 characters to the right. the below .vimrc mapping doesn't work: nmap <c-;> 7; what's wrong? ...

JNA union structure mapping

In JNA, how do you map a union structure like the following XEvent from Xlib typedef union _XEvent { int type; /* must not be changed */ XAnyEvent xany; XKeyEvent xkey; XButtonEvent xbutton; XMotionEvent xmotion; XCrossingEvent xcrossing; XFocusChangeEvent xfocus; XExposeEvent xexpose; XGraphicsExp...

How to create map<string, class::method> in c++ and be able to search for function and call it?

I'm trying to create a map of string and method in C++, but I don't know how to do it. I would like to do something like that (pseudocode): map<string, method> mapping = { "sin", Math::sinFunc, "cos", Math::cosFunc, ... }; ... string &function; handler = mapping.find(function); int result; if (handler != NULL) result = (int) ...

How to create map with keys/values inside class body once (not each time functions from class are called)

I would like to create C++ class which would allow to return value by given key from map, and key by given value. I would like also to keep my predefined map in class content. Methods for getting value or key would be static. How to predefine map statically to prevent creating map each time I call getValue(str) function? class Mapping {...

Round-trip Property on Entity Framework entity

Hi, I have a Candidate entity that is read/write to a Candidate table under EF 4.0. This all works great but I need to load another type of Candidate from our existing membership table via a stored proc and Function Import. From the applications POV they are also a Candidate they just happen to have an additional attribute of Grade. ...

vim mapping normal keys like shift

I want to map a key in Vim such that i would hold down a key, say a, and then press some other key, say b. And then the holding down of the a would change what the pressing of b does. Like the way we use shift, just with all the normal characters of the keyboard. Is that possible? And if so, how? ...

MySQL Lat/Lng Boundary with even distribution of results

In a map application i display markers on a map based on the visible map area using a query similar to the following. SELECT * FROM (`properties`) WHERE `lat` > '-11.824448' AND `lat` < '84.124002' AND `lng` > '-152.243398' AND `lng` < '-39.743398' LIMIT 20; Due to the index on the table this results in results appearing us...

What is the easiest way to visualize transactional data utilizing using a data dump like MySQL, CSV etc etc

Essentially I want to be able to feed it data and see fancy charts and graphs displaying information out of the data based on x amount of transactions etc etc and/or SQL statements etc. It does not matter if it is client based or web based. Open source would be great but commercial is fine also. Thanks ...

Grails/GORM Legacy DB One-to-Many mappedBy issue

I have a legacy DB with rather simple structure. I have "rolls" that contain "rollTotals". Roll has a primary key of "rollID" and RollTotals have a composite key on "rollID" and "category". So in Grails, I have: class Roll { Integer id ... static hasMany = [ rollTotals: RollTotal ] static mapping = { table('roll...