Search Results

Search found 32789 results on 1312 pages for 'object relational mapping'.

Page 15/1312 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Mapping a ER model to Rails

    - by Thiago
    Hi there, I want to map the following ER schema to rails: I have an entity called "user" which has a self relationship called "has friend", which has an attribute called "status". In code, I would like to run: User.friends and it should return me an array of users, containing the users that I'm friend of. It shouldn't matter in which side of the relationship I am (i.e. whether I'm the friender or the friendee). Any thoughts?

    Read the article

  • NHibernate MySQL Mapping Set Column Type

    - by LnDCobra
    In my MySQL database, I have the following column type. Field | Type | Null | ---------------------------------- Column_priv | set('Select','Insert','Update','References') | No | And I cannot figure out what to map this to. Can anyone tell me how I can map this to something?

    Read the article

  • Mapping Hashmap of Coordinates in Hibernate with Annotation

    - by paddydub
    I've just started using hibernate and I'm trying to map walking distance between two coordinates into a hashmap, There can be many connections from one "FromCoordinate" to another "ToCoordinate". I'm not sure if i've implemented this correctly, What annotations do i need to map this MashMap? Thanks HashMap coordWalkingConnections = new HashMap(); @Entity @Table(name = "COORDCONNECTIONS") public class CoordinateConnection implements Serializable{ private static final long serialVersionUID = -1624745319005591573L; /** auto increasing id number */ @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ID") @id private int id; @Embedded public FromCoordinate fromCoord; @Embedded public ToCoordinate toCoord; HashMap<FromCoordinate, ArrayList<ToCoordinate >> coordWalkingConnections = new HashMap<FromCoordinate, ArrayList<ToCoordinate >>(); } public class FromCoordinate implements ICoordinate { @Column(name = "FROM_LAT") private double latitude; @Column(name = "FROM_LNG") private double longitude; } public class ToCoordinate implements ICoordinate { @Column(name = "TO_LAT") private double latitude; @Column(name = "TO_LNG") private double longitude; @Column(name = "DISTANCE") private double distance; } DATABASE STRUCTURE id FROM_LAT FROM_LNG TO_LAT TO_LNG Dist 1 43.352669 -6.264341 43.350012 -6.260653 0.38 2 43.352669 -6.264341 43.352669 -6.264341 0.00 3 46.352669 -6.264341 43.353373 -6.262013 0.17 4 47.352465 -6.265865 43.351290 -6.261200 0.25 5 45.452578 -6.265768 43.352788 -6.264396 0.01 6 45.452578 -6.265768 45.782788 -6.234523 0.01 ..... ... . Example HashMap for HashMap<Coordinate, ArrayList<Coordinate>> <KEY{43.352669 -6.264341}, Arraylist VALUES{(43.350012,-6.260653,0.383657), (43.352669, -6.264341, 0.000095), (43.353373, -6.262013, 0.173201)}> <KEY{47.352465 -6.265865}, Arraylist VALUES{(43.351290,-6.261200,0.258781)}> <KEY{45.452578 -6.265768}, Arraylist VALUES{(43.352788,-6.264396,0.013726),(45.782788,-6.234523,0.017726)}>

    Read the article

  • Hibernate Mapping Annotation Question?

    - by paddydub
    I've just started using hibernate and I'm trying to map walking distance between two coordinates into a hashmap, There can be many connections from one "FromCoordinate" to another "ToCoordinate". I'm not sure if i've implemented this correctly, What annotations do i need to map this MashMap? Thanks @Entity @Table(name = "COORDCONNECTIONS") public class CoordinateConnection implements Serializable{ private static final long serialVersionUID = -1624745319005591573L; /** auto increasing id number */ @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ID") @id private int id; @Embedded public FromCoordinate fromCoord; @Embedded public ToCoordinate toCoord; HashMap<Coordinate, ArrayList<Coordinate>> coordWalkingConnections = new HashMap<Coordinate, ArrayList<Coordinate>>(); } public class FromCoordinate implements ICoordinate { @Column(name = "FROM_LAT") private double latitude; @Column(name = "FROM_LNG") private double longitude; } public class ToCoordinate implements ICoordinate { @Column(name = "TO_LAT") private double latitude; @Column(name = "TO_LNG") private double longitude; @Column(name = "DISTANCE") private double distance; } DATABASE STRUCTURE id FROM_LAT FROM_LNG TO_LAT TO_LNG Dist 1 43.352669 -6.264341 43.350012 -6.260653 0.38 2 43.352669 -6.264341 43.352669 -6.264341 0.00 3 46.352669 -6.264341 43.353373 -6.262013 0.17 4 47.352465 -6.265865 43.351290 -6.261200 0.25 5 45.452578 -6.265768 43.352788 -6.264396 0.01 6 45.452578 -6.265768 45.782788 -6.234523 0.01 ..... ... . Example HashMap for HashMap<Coordinate, ArrayList<Coordinate>> <KEY{43.352669 -6.264341}, Arraylist VALUES{(43.350012,-6.260653,0.383657), (43.352669, -6.264341, 0.000095), (43.353373, -6.262013, 0.173201)}> <KEY{47.352465 -6.265865}, Arraylist VALUES{(43.351290,-6.261200,0.258781)}> <KEY{45.452578 -6.265768}, Arraylist VALUES{(43.352788,-6.264396,0.013726),(45.782788,-6.234523,0.017726)}>

    Read the article

  • nHibernate Mapping file

    - by bharat
    <property name="NetworkRunId" column="Network_Run_Id" /> <property name="StudyKey" column="Study_Key" insert="false" update="false" /> <property name="AnnualizationFactor" column="Annualization_Factor" /> <property name="CreateDate" column="Create_Date" /> <property name="ModifyDate" column="Modify_Date" /> <many-to-one name="StudyInfo" class="Study" lazy="false" cascade="save-update"> <column name="Study_Key" /> </many-to-one> <many-to-one name="MemberInfo" class="BusinessDataEntities.Domain.NetworkAdministration.VHAMemberCompany, BusinessDataEntities" lazy="false"> <column name="Member_ID" /> </many-to-one> <many-to-one name="NetworkRunStudyXrefInfo" class="BusinessDataEntities.Domain.NetworkAdministration.NetworkRunStudyXref, BusinessDataEntities" lazy="false"> <column name="Network_Run_Id" /> </many-to-one> <join table="[HCO_Spend_Network_Run_Study]"> <key column="HCO_Spend_Id" /> <property name="NetworkRunId" column="Network_Run_Id" insert="false" update="false"/> </join> issue with the Network run id not exist in the first table but i have a join that is having the Network_Run_Id as property how do i fix this

    Read the article

  • Mapping Application for Middle East

    - by Faraz
    We have a desktop application that has been using MapPoint for displaying data on a European map. We now want to support Middle East maps, but MapPoint only support North America and Europe. Is there any other alternative to MapPoint that can be easily integrated in a .NET based Win Forms application?

    Read the article

  • Grails: URL mapping - how to pass file extension ?

    - by Olexandr
    Hi. I have some folder with different files. I want to use something like this: http://myserver.com/foo/bar/test.html I'm using this way to obtain path: "/excursion/$path**" (controller:"excursion", action:"sweet") But it doesn't helps with file extensions... How to disable file extensions truncating ?

    Read the article

  • Fluent NHibernate mapping List<Point> as value to single column

    - by Paja
    I have this class: public class MyEntity { public virtual int Id { get; set; } public virtual List<Point> Vectors { get; set; } } How can I map the Vectors in Fluent NHibernate to a single column (as value)? I was thinking of this: public class Vectors : ISerializable { public List<Point> Vectors { get; set; } /* Here goes ISerializable implementation */ } public class MyEntity { public virtual int Id { get; set; } public virtual Vectors Vectors { get; set; } } Is it possible to map the Vectors like this, hoping that Fluent NHibernate will initialize Vectors class as standard ISerializable? Or how else could I map List<Point> to a single column? I guess I will have to write the serialization/deserialization routines myself, which is not a problem, I just need to tell FNH to use those routines. I guess I should use IUserType or ICompositeUserType, but I have no idea how to implement them, and how to tell FNH to cooperate.

    Read the article

  • efficient list mapping in python

    - by Joey
    Hi everyone, I have the following input: input = [(dog, dog, cat, mouse), (cat, ruby, python, mouse)] and trying to have the following output: outputlist = [[0, 0, 1, 2], [1, 3, 4, 2]] outputmapping = {0:dog, 1:cat, 2:mouse, 3:ruby, 4:python, 5:mouse} Any tips on how to handle given with scalability in mind (var input can get really large).

    Read the article

  • nhibernate fluent bool to smallint mapping

    - by Raul
    In my application I have a bool property named DisplayIndicator. In the database (DB2) it's correspondence is DISPL_IND column of type smallint. The correspondence is the following: [DisplayINdicator=True, DISPL_IND=1] and [DisplayINdicator=False, DISPL_IND=0] Is it possible to map using nhibernate fluence the bool property to smallint?

    Read the article

  • Mapping of interconnection with nhibernate

    - by Mauro Destro
    I have to describe interconnection between objects. public class Entity { public string Name {get;set;} public IList<Entity> Connections {get;set;} } How can i persist this? I add another layer of complexity: querying on a specific date a connection between two entities can't be already defined. So probably I need a support table that contain a structure like Id, Source, Destination, ValidFrom, ValidUntil Mauro

    Read the article

  • Nhibernate mapping: fixed count multiple members instead of collection

    - by AhmetC
    I don't want to put wheels into a collection. How can i map kind of relation? Class Wheel { int id; Car Owner; } Class Car { int id; Wheel Wheel1; Wheel Wheel2; Wheel Wheel3; Wheel Wheel4; } I tried this but Wheelmap.Owner comes always null : Class WheelMap : ClassMap<Wheel> { Id(x=>x.Id); References(x=>x.Owner); } Class CarMap : ClassMap<Car> { Id(x=>x.Id); References(x=>x.Wheel1).Cascade.All(); References(x=>x.Wheel2).Cascade.All(); References(x=>x.Wheel3).Cascade.All(); References(x=>x.Wheel4).Cascade.All(); }

    Read the article

  • Offline Mapping API

    - by Aaron M
    Are there any services available that allow me to manipulate maps in an offline setting? I am working on a project that requires me to take a map and based on features on the map, generate a game world. I have looked at a few of the API's for different providers: Google, ms, etc. The API's I looked seem to be strictly showing a user a map. I am looking for something that allows me to create a derivative of a map (the Gameworld), that will never be seen by the public, and is only used by the game engine. However one caveat is that I would like to be able to link the derivative created for use by the game engine, with something I can show the user. As an example. Think of a cross country racing sim. Users cannot control the vehicles directly in this game, they can only control the cars setup, driver, etc. I create a gameworld from a map. The gameworld data (driver position, etc) is overlayed onto a real map. A race might last several days. The only interaction users have with the real map is viewing their position on the map, and where they are in relation to the others. I don't want to violate the terms of the API here. I read Googles API TOS, and it seems to me that creating the gameworld would violdate their TOS. The features I really need are the following The ability to locate a specific place on the map by lat/long The ability/rights to grab those maps and save them as an image file temporarily for processing The ability/rights to store a gameworld that is based on the real map The ability to show a user a map with an overlay (this is optional. I can use googles API, or any other one that supports lat/long.)

    Read the article

  • implmenting 1 to n mapping for ORM c++

    - by karan
    I am writing a project where i need to implment a stripped down version of an ORM solution in c++. I am struck in implmenting 1-n relationships for the same. For instance, if following are the classes: class A { } class B { std::list _a_list; } I have provided load/save menthods for loading/saving to the db. Now, if i take the case of B : Say , for the following workflow : 1 entry from _a_list is removed 1 entry from _a_list is modified 1 entry is added to _a_list Now, i need to update the db using something like "b.save()". So, what would be the best way to save the changes,i.e, identify the additions, deletions and updations to _a_list.

    Read the article

  • Type-safe mapping from Class<T> to Thing<T>

    - by Joonas Pulakka
    I want to make a map-kind of container that has the following interface: public <T> Thing<T> get(Class<T> clazz); public <T> void put(Class<T> clazz, Thing<T> thing); The interesting point is that the Ts in each Class<T><- Thing<T> pair is the same T, but the container should be able to hold many different types of pairs. Initially I tried a (Hash)Map. But, for instance, Map<Class<T>, Thing<T>> is not right, because then T would be same T for all pairs in that map. Of course, Map<Class<?>, Thing<?>> works, but then I don't have type-safety guarantees so that when I get(String.class), I can't be sure that I get a Thing<String> instance back. Is there a way to accomplish the kind of type safety that I'm looking for?

    Read the article

  • Mapping Vectors

    - by Dan Snyder
    Is there a good way to map vectors? Here's an example of what I mean: vec0 = [0,0,0,0,0,0,0,0,0,0,0] vec1 = [1,4,2,7,3,2] vec2 = [0,0,0,0,0,0,0,0,0] vec2 = [7,2,7,9,9,6,1,0,4] vec4 = [0,0,0,0,0,0] mainvec = [0,0,0,0,0,0,0,0,0,0,0,1,4,2,7,3,2,0,0,0,0,0,0,0,0,0,7,2,7,9,9,6,1,0,4,0,0,0,0,0,0] Lets say mainvec doesn't exist (I'm just showing it to you so you can see the general data structure in mind. Now say I want mainvec(12) which would be 4. Is there a good way to map the call of these vectors without just stitching them together into a mainvec? I realize I could make a bunch of if statements that test the index of mainvec and I can then offset each call depending on where the call is within one of the vectors, so for instance: mainvec(12) = vec1(1) which I could do by: mainvec(index) if (index >=13) vect1(index-11); I wonder if there's a concise way of doing this without if statements. Any Ideas?

    Read the article

  • Implementing 1 to n mapping for ORM c++

    - by karan
    I am writing a project where I need to implement a stripped down version of an ORM solution in C++. I am struck in implementing 1-n relationships for the same. For instance, if the following are the classes: class A { ... } class B { ... std::list<A> _a_list; ... } I have provided load/save methods for loading/saving to the db. Now, if I take the case of B and the following workflow: 1 entry from _a_list is removed 1 entry from _a_list is modified 1 entry is added to _a_list Now, I need to update the db using something like "b.save()". So, what would be the best way to save the changes, i.e, identify the additions, deletions and updates to _a_list.

    Read the article

  • Left Outer Join on Many-to-One Mapping

    - by Colin Bowern
    I have a reference to call that may or may not be there. When I add the nullable option it still doing Inner Join when I want an Outer Left Join (show the left even if the right is null). Is this possible in the NH map? References(x => x.DefaultCategory, "CATEGORY_ID") .Nullable();

    Read the article

  • Subdomain mapping to another external subdomain

    - by Davorin
    I'm trying to map help.domain1.com to help.domain2.com. I've seen this on UserVoice. They let you map something.yourdomain.com to something.uservoice.com. On domain1.com I've set up a CNAME to help.domain2.com. It works fine but when I open help.domain1.com I get the content of domain2.com instead of help.domain2.com. After some experimenting I've realized that this is an expected behavior. So my question is what do I have to do on domain2.com (or maybe on domain1.com?) to have it show content of subdomain "help.domain2.com" when I navigate help.domain1.com? (I'm using Plesk and the OS is Windows Server 2003)

    Read the article

  • Haskell - mapping the odd placed values and the even placed values differently

    - by Abstract
    Hey guys, is there an easy way. To take a list of numbers, say 123456. Then multiply the odd placed by three and the even placed by 1. i.e. (1 * 3) + (2 * 1) + (3 * 3) + (4*1) + (5*3) + (6*1) i was thinking the map function somewhere along the lines. But i don't know how to map *3 to just the odd placed values. Oh and if you could give me the version not in prelude that would be great like the actual function or functions, as if its being imported from an external haskell file Thanks for the help

    Read the article

  • Mapping One-to-One subclass in Fluent NHibernate

    - by Mike C.
    I have the following database structure: Event table Id - Guid (PK) Name - NVarChar Description - NVarChar SpecialEvent table Id - Guid (PK) StartDate - DateTime EndDate - DateTime I have an abstract Event class, and a SpecialEvent class that inherits from it. Eventually I will have a RecurringEvent class which will inherit from the Event class also. I'd like to map the SpecialEvent class while preserving a one-to-one relationship mapped with the Ids, if possible. Can anybody point me in the correct direction? Thanks!

    Read the article

  • Google App engine Url Mapping using WSGIAppl and regx grouping Help Needed

    - by spidee
    Hi take this example from google docs class BrowseHandler(webapp.RequestHandler): > def get(self, category, product_id): > # Display product with given ID in the given category. > > > # Map URLs like /browse/(category)/(product_id) to > BrowseHandler. application = > webapp.WSGIApplication([(r'/browse/(.*)/(.*)', > BrowseHandler) > ], > debug=True) > > def main(): > run_wsgi_app(application) > > if __name__ == '__main__': > main() How can i change the regx groupings so that Product id is optional ie the url http://yourdomain.com/category will be sent to the browse handler in the current above example you must add a product id or at least the / after the category ie http://yourdomain.com/category/ r'/browse/(.)/(.)' Any ideas?

    Read the article

  • Choropleth mapping issue in R

    - by chasec
    I am trying to follow the tutorial described here: http://www.thisisthegreenroom.com/2009/choropleths-in-r/ The below code executes, but it is either not matching my dataset with the maps_counties data properly, or it isn't plotting it in the order I would expect. For example, the resulting areas for the greater NYC area show no density while random counties in PA show the highest density. The general format of my data table is: county state count fairfield connecticut 17 hartford connecticut 6 litchfield connecticut 3 new haven connecticut 12 ... ... westchester new york 70 yates new york 1 luzerne pennsylvania 1 Note this data is in order by state and then county and includes data for CT, NJ, NY, & PA. First, I read in my data set: library(maps) library(RColorBrewer) d <- read.table("gissum.txt", sep="\t", header=TRUE) #Concatenate state and county info to match maps library d$stcon <- paste(d$state, d$county, sep=",") #Color bins colors = brewer.pal(5, "PuBu") d$colorBuckets <- as.factor(as.numeric(cut(d$count,c(0,10,20,30,40,50,300)))) Here is my matching mapnames <- map("county",plot=FALSE)[4]$names colorsmatched <- d$colorBuckets [na.omit(match(mapnames ,d$stcon))] Plotting: map("county" ,c("new york","new jersey", "connecticut", "pennsylvania") ,col = colors[d$colorBuckets[na.omit(match(mapnames ,d$stcon))]] ,fill = TRUE ,resolution = 0 ,lty = 0 ,lwd= 0.5 ) map("state" ,c("new york","new jersey", "connecticut", "pennsylvania") ,col = "black" ,fill=FALSE ,add=TRUE ,lty=1 ,lwd=2 ) map("county" ,c("new york","new jersey", "connecticut", "pennsylvania") ,col = "black" ,fill=FALSE ,add=TRUE , lty=1 , lwd=.5 ) title(main="Respondent Home ZIP Codes by County") I am sure I am missing something basic re: the order in which the maps function plots items - but I can't seem to figure it out. Thanks for the help. Please let me know if you need any more information.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >