Search Results

Search found 4565 results on 183 pages for 'nhibernate mapping'.

Page 75/183 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Map external directory to web.xml

    - by prometheus
    Is there an easy way to map a directory in the web.xml or other deployment descriptor (jetty.xml, etc) files? For example, if I have a directory /opt/files/ is there a way that I can access its files and sub-directories by visiting http://localhost/some-mapping/? It strikes me that there should be some simple way of doing this, but I haven't been able to find out how (via google, stackoverflow, etc). All I've found are servlets that mimic fileservers, which is not what I would like. For reference I am using jetty on an AIX box.

    Read the article

  • Best approach to convert XML to RDF/XML using an ontology

    - by krisvandenbergh
    I have an XML which uses the XPDL standard (which has an XML schema). What I'm trying to do now is to convert its content to RDF format (serialized in XML), in terms of a certain ontology. Clearly, there needs to be some sort of mapping here. I would like to do this using PHP. The thing is, I have no idea how to do this best. I know how to read an XML file, but how would the mappings occur? What would be a good approach?

    Read the article

  • How do you use the LINQ to SQL designer to generate accessor methods for subclasses?

    - by Pricey
    Above is the LINQ to SQL designer view for my data context. Below is the relevant code: public System.Data.Linq.Table<ActivityBase> ActivityBases { get { return this.GetTable<ActivityBase>(); } } ... [Table(Name="dbo.Activities")] [InheritanceMapping(Code="1", Type=typeof(ActivityBase), IsDefault=true)] [InheritanceMapping(Code="2", Type=typeof(Project))] [InheritanceMapping(Code="3", Type=typeof(ProjectActivity))] [InheritanceMapping(Code="5", Type=typeof(Task))] [InheritanceMapping(Code="4", Type=typeof(Activity))] public abstract partial class ActivityBase : INotifyPropertyChanging, INotifyPropertyChanged { ... Is there a way to generate accessor methods for the subclasses as shown in the inheritance mapping above (Project, Task, etc...) without doing it manually? I added them manually but then a change in the designer overwrites any manual changes. Am i doing this wrong? should I not be making accessors for the sub classes? filtering from ActivityBase seems worse to me. Thanks for any help on this.

    Read the article

  • DTO and mapper generation from Domain Objects

    - by Nicolas
    I have plenty of java domain objects that I need to transform to DTOs. Please, don't start with the anti-pattern thing, the Domain Objects are what they are because of a long history, and I can't modify them (or not too much, see below). So, of course, we've passed the age of doing all that manually. I've looked around, and dozer seems the framework of choice for DTO mapping. But... what I'd really like is this: annotate classes and fields that I want in DTO, and run a tool that would generate the DTOs and the mappers. Does that sound too unreasonable? Does such a tool already exist?

    Read the article

  • Shadow maps unable to properly project shadows in some situations?

    - by meds
    In the shadow map sample provided by Microsoft I've noticed an issue where shadows are not properly projected when thin geometry is projected at high angles, see here the shadows being projected, notice the poles from the lights are not projected: http://imgur.com/QwOBa.png And in this screenshot we see things from the lights perspective, not ethe poles are clearly visible: http://imgur.com/k2woZ.png So two questions really, is this an actual bug or a limitation with shadow mapping and if it's a bug how can I fix it? The source is directly from the Microsoft DirectX Sample Browser 'ShadowMap' sample from July 2004, the sample browser is the latest August 2009 one.

    Read the article

  • How to shortcut diamond character in vim

    - by temujin.ya.ru
    In the dictionary file, which I am editing I often need to insert character "?" on place of <. Is there a way to map "?" to some key so that I press "r" for replace and then my_shortcut to have < replaced by "?"? I found a way to make imap mapping in .vimrc: :imap <> ? But changing to inset mode is sub-optimal, would that be possible to make it all in replace mode and what should I write in .vimrc for that?

    Read the article

  • What is a good solution to link different tables in Hibernate based on some field value?

    - by serg555
    I have article table and several user tables a_user, b_user, ... with exactly the same structure (but different data). I can't change anything in *_user tables except their table name prefix but can change everything else (user tables contain only user information, there is nothing about article or user_type in them). I need to link article to a user (many-to-one), but user table name is defined by user_type field. For example Article table record: ... user_id="5" user_type="a" means that it is linked to a user with id=5 from a_user table (id 5 is not unique in users scope, each user table can have its id 5). Any suggestions how to handle this situation? How can I map this relation in Hibernate (xml mapping, no annotations) so it will automatically pick up correct user for an article during select/update? How should I map user tables (one or multiple classes?)? I would need to run some queries like this: from Article a where a.userType=:type and a.user.name=:name Thanks.

    Read the article

  • OneToMany association updates instead of insert

    - by Shvalb
    I have an entity with one-to-many association to child entity. The child entity has 2 columns as PK and one of the column is FK to the parent table. mapping looks like this: @OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER ) @JoinColumn(name="USER_RESULT_SEQUENCES.USER_RESULT_ID", referencedColumnName="USER_RESULT_ID", unique=true, insertable=true, updatable=false) private List<UserResultSequence> sequences; I create an instance of parent and add children instances to list and then try to save it to DB. If child table is empty it inserts all children and it works perfectly. if the child table is not empty it updates existing rows! I don't know why it updates instead of inserts, any ideas why this might happen?? Thank you!

    Read the article

  • Mapping capslock to control on Mac OS X: works for some things, but not others?

    - by keflavich
    I've mapped my capslock key to control using the Modifier Keys mapping in System Preferences: Keyboard. I've also tried mapping to "right control" instead of "left control" as per http://hints.macworld.com/article.php?story=20060825072451882 using a plist editor. The mapping seems to work in all cases except one: I can't use capslock with left-shift to make key mappings or apparently do anything else. capslock (as control) with right-shift works. I'm primarily testing by using control-tab / control-shift-tab to switch between tabs. Using the on-screen-keyboard viewer, I can get capslock-shift-(just about anything) to work, but not capslock-leftshift-tab. My best guess is that somehow the particular keyboard I'm working on is faulty, but I'm curious whether anyone else can reproduce this or has any ideas.

    Read the article

  • Hack/software to easily move screen mapping of a wacom tablet?

    - by Riyaah
    I would like to move/manipulate the mapping of my Wacom tablet to my screen as easily as with Inklet: http://tenonedesign.com/inklet.php Is anyone aware of any software or hack to acheive this on Mac OS X? If not I'm thinking about trying to write a script that centers the mapping on the current cursor position, and then bidning that to a button on my tablet. Combined with a script for toggling between fullscreen/part of screen-mapping that should be enough. My idea so far is to edit the .prefs file since it's plain XML, and then restart the tablet driver. But any pointers relating to this would be most welcome, since my knowledge of this kind of things is rudimentary.

    Read the article

  • Core Data migration of to-one relationship to to-many relationship

    - by westsider
    I have a deployed app that samples measurements from sensors (e.g., Temp °C, Pressure kPa). The user can create Experiments and collect samples. Each sample is stored as a Run, such that there is a one-to-many relationship from Experiment to Run. In the interest of performance, Run has a to-one relationship with Data entity (which is where the actual raw data is stored); this allows some Run attributes to be loaded without necessarily loading lots of data. Most of our sensors have multiple measurements, so it would be nice to store all the data that is actually being sampled. But this means that the Run <--- Data relationship needs to become Run <-- Data (to use Xcode's convention). I am faced with trying to migrate data from old Run to-one Data model to new Run to-many Data model. Can this be done using Mapping Models? If so, does anyone have any pointers to examples? If not, does anyone have any pointers to examples of how to do that? Thanks for any pointers or advice.

    Read the article

  • OpenGL-ES Texture Atlas. t axis is inverted.

    - by Feet
    I'm mapping a texture from my texture atlas to a square on a cube. For some reason, the t axis is inverted with 0 being at the top and 1 being at the bottom. Also, I have to specify the texture coordinates in clockwise order rather than counter-clockwise. I am using counter-clockwise windings. The vertices, indices and texture coordinates I'm using are below. float vertices[] = { // Front face -width, -height, depth, // 0 width, -height, depth, // 1 width, height, depth, // 2 -width, height, depth, // 3 // Back Face width, -height, -depth, // 4 -width, -height, -depth, // 5 -width, height, -depth, // 6 width, height, -depth, // 7 // Left face -width, -height, -depth, // 8 -width, -height, depth, // 9 -width, height, depth, // 10 -width, height, -depth, // 11 // Right face width, -height, depth, // 12 width, -height, -depth, // 13 width, height, -depth, // 14 width, height, depth, // 15 // Top face -width, height, depth, // 16 width, height, depth, // 17 width, height, -depth, // 18 -width, height, -depth, // 19 // Bottom face -width, -height, -depth, // 20 width, -height, -depth, // 21 width, -height, depth, // 22 -width, -height, depth, // 23 }; short indices[] = { // Front // Back 0,1,2, 0,2,3, 4,5,6, 4,6,7, // Left // Right 8,9,10, 8,10,11, 12,13,14, 12,14,15, // Top // Bottom 16,17,18, 16,18,19, 20,21,22, 20,22,23, }; float textures[] = { // Front 0.0f, 0.0f, 0.25f, 0.0f, 0.25f, 0.25f, 0.0f, 0.25f, // Back 0.25f, 0.0f, 0.50f, 0.0f, 0.50f, 0.25f, 0.25f, 0.25f, // Left 0.50f, 0.0f, 0.75f, 0.0f, 0.75f, 0.25f, 0.50f, 0.25f, // Right 0.75f, 0.0f, 1f, 0.0f, 1f, 0.25f, 0.75f, 0.25f, // Top 0.0f, 0.25f, 0.25f, 0.25f, 0.25f, 0.50f, 0.0f, 0.50f, // Bottom 0.25f, 0.25f, 0.50f, 0.25f, 0.50f, 0.50f, 0.25f, 0.50f, };

    Read the article

  • Using LINQ to map dynamically (or construct projections)

    - by CodeGrue
    I know I can map two object types with LINQ using a projection as so: var destModel = from m in sourceModel select new DestModelType {A = m.A, C = m.C, E = m.E} where class SourceModelType { string A {get; set;} string B {get; set;} string C {get; set;} string D {get; set;} string E {get; set;} } class DestModelType { string A {get; set;} string C {get; set;} string E {get; set;} } But what if I want to make something like a generic to do this, where I don't know specifically the two types I am dealing with. So it would walk the "Dest" type and match with the matching "Source" types.. is this possible? Also, to achieve deferred execution, I would want it just to return an IQueryable. For example: public IQueryable<TDest> ProjectionMap<TSource, TDest>(IQueryable<TSource> sourceModel) { // dynamically build the LINQ projection based on the properties in TDest // return the IQueryable containing the constructed projection } I know this is challenging, but I hope not impossible, because it will save me a bunch of explicit mapping work between models and viewmodels.

    Read the article

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

    - by A. Rex
    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 edge weights reflecting distances. I want to be able to quickly compute directions from one arbitrary point to another. Sometimes these points will be close together (within one city) while sometimes they will be far apart (cross-country). Graph algorithms like Dijkstra's algorithm will not work because the graph is enormous. Luckily, heuristic algorithms like A* will probably work. However, our data is very structured, and perhaps some kind of tiered approach might work? (For example, store precomputed directions between certain "key" points far apart, as well as some local directions. Then directions for two far-away points will involve local directions to a key points, global directions to another key point, and then local directions again.) What algorithms are actually used in practice? PS. This question was motivated by finding quirks in online mapping directions. Contrary to the triangle inequality, sometimes Google Maps thinks that X-Z takes longer and is farther than using an intermediate point as in X-Y-Z. But maybe their walking directions optimize for another parameter, too? PPS. Here's another violation of the triangle inequality that suggests (to me) that they use some kind of tiered approach: X-Z versus X-Y-Z. The former seems to use prominent Boulevard de Sebastopol even though it's slightly out of the way. (Edit: this example doesn't work anymore, but did at the time of the original post. The one above still works as of early November 2009.)

    Read the article

  • sharp architecture, FluentNHibernate, automapper, DTO, 1:m persistence question

    - by csetzkorn
    Let us say we have a class A which has a reference to another class B (1:m) public class A { public virtual B B { get; set; } } I reflect this using FluentNHibernate within the sharp architecture and also manage to ‘initialise’ A and its B via a DTO and Automapper. The DTO contain A’s values and B (just B’s id value/A’s foreign key initialised). I was hoping that I can persist A by ‘just’ using its 'out of the box repository' without requiring B’s repository using: SaveOrUpdate(A); (A has been mapped using AutoMapper and contains B with its Id initialised) Was my assumption too naive? Can I achieve this somehow (without ever requiring B’s repository)? Or do I have to use A’s and B’s repository in, for example, the controller or some other service layer? Thanks. Best wishes, Christian

    Read the article

  • HiLo vs Identity?

    - by Mendy
    This is the same question as: http://stackoverflow.com/questions/803872/hilo-or-identity Let's take the database of this site as an example. Lets say that the site has the following tables: Posts. Votes. Comments. What is the best strategy to use for it: Identity - which is more common. OR HiLo - which give best performance. Edit: if HiLo is the best, how the structure of the DB would be?

    Read the article

  • How to retrieve row count of one-to-many relation while also including original entity?

    - by kaa
    Say I have two entities Foo and Bar where Foo has-many Bar's, class Foo { int ImportantNumber { get; set; } IEnumerable<Bar> Bars { get; set; } } class FooDTO { Foo Foo { get; set; } int BarCount { get; set; } } How can I efficiently sum up the number of Bars per Foo in a DTO using a single query, preferrably only with the Criteria interface. I have tried any number of ways to get the original entity out of a query with ´SetProjection´ but no luck. The current theory is to do something like SELECT Foo.*, BarCounts.counts FROM Foo LEFT JOIN ( SELECT fooId, COUNT(*) as counts FROM Bar GROUP BY fooId ) AS BarCounts ON Foo.id=BarCounts.fooId but with Criterias, and I just can't seem to figure out how.

    Read the article

  • for my project I have problem in report

    - by pink rose
    public class stack { private int Array[]; private int top = -1; public int size; public stack(int size) { this.size=size; Array = new int[size]; } public void push(int j) { if (top < size) { Array[++top] = j; } } public int pop() { return Array[top--]; } public int top() { return Array[top]; } public boolean isEmpty() { return (top == -1); } } import javax.swing.JOptionPane; public class menu { private static stack s; private static int numbers[]; public static void main(String args[]) { start(); } public static void start() { int i = Integer.parseInt(JOptionPane.showInputDialog("1. size of array\n2. data entry\n3. display content\n4. exit")); switch (i) { case 1: setSize(); break; case 2: addElement(); break; case 3: showElements(); break; case 4: exit(); } } public static void setSize() { int size = Integer.parseInt(JOptionPane.showInputDialog("Please Enter The Size")); s = new stack(size); numbers = new int[10]; start(); } public static void addElement() { for(int x=0;x<s.size;x++) { int e = Integer.parseInt(JOptionPane.showInputDialog("Please Enter The Element")); numbers[e]++; s.push(e); } start(); } public static void showElements() { String result = ""; int temp; while (!s.isEmpty()) { temp = s.pop(); if (numbers[temp] == 1) { result = temp+result; } } JOptionPane.showMessageDialog(null, result); start(); } public static void exit() { System.exit(0); } } This my project I was finished but I have problem in question in my report Conclusion. It should summarize the state of your project and indicate which part of your project is working and which part is not working or with limitations. You may also provide your suggestions and comments to this project what I can answer I didn't have any idea

    Read the article

  • LINQ self referencing query

    - by Chris
    I have the following SQL query: select p1.[id], p1.[useraccountid], p1.[subject], p1.[message], p1.[views], p1.[parentid], case when p2.[created] is null then p1.[created] else p2.[created] end as LastUpdate from forumposts p1 left join ( select parentid, max(created) as [created] from forumposts group by parentid ) p2 on p2.parentid = p1.id where p1.[parentid] is null order by LastUpdate desc Using the following class: public class ForumPost : PersistedObject { public int Views { get; set; } public string Message { get; set; } public string Subject { get; set; } public ForumPost Parent { get; set; } public UserAccount UserAccount { get; set; } public IList<ForumPost> Replies { get; set; } } How would I replicate such a query in LINQ? I've tried several variations, but I seem unable to get the correct join syntax. Is this simply a case of a query that is too complicated for LINQ? Can it be done using nested queries some how? The purpose of the query is to find the most recently updated posts i.e. replying to a post would bump it to the top of the list. Replies are defined by the ParentID column, which is self-referencing.

    Read the article

  • Order by null/not null with ICriteria

    - by Kristoffer
    I'd like to sort my result like this: First I want all rows/objects where a column/property is not null, then all where the colmn/property is null. Then I want to sort by another column/property. How can I do this with ICriteria? Do I have to create my own Order class, or can it be done with existing code? ICriteria criteria = Session.CreateCriteria<MyClass>() .AddOrder(Order.Desc("NullableProperty")) // What do I do here? IProjection? Custom Order class? .AddOrder(Order.Asc("OtherProperty"));

    Read the article

  • Fine tune some SQL called multiple times

    - by Carl
    Hi all, I currently have an SQL query which is currently called multiple times like this (pseudo code): foreach(KeyValuePair kvp in someMapList) { select col1 from table where col2 = kvp.key and col3 = kvp.value; //do some processing on the returned value } The above could obviously call the database a large number of times if it is a big list of pairs. Can anyone think of a more efficient piece of SQL which could essentially return a list of specific values based on a list of two unique pieces of information so that the processing can be done in bulk? One obvious one would be to build up a big piece of SQL with ORs but this would probably be quite inefficient? Thanks Carl

    Read the article

  • How to use PredicateBuilder with nested OR conditionals in Linq

    - by tblank
    I've been very happily using PredicateBuilder but until now have only used it for queries with only either concatenated AND statements or OR statements. Now for the first time I need a pair of OR statements nested along with a some AND statements like this: select x from Table1 where a = 1 AND b = 2 AND (z = 1 OR y = 2) Using the documentation from Albahari, I've constructed my expression like this: Expression<Func<TdIncSearchVw, bool>> predicate = PredicateBuilder.True<TdIncSearchVw>(); // for AND Expression<Func<TdIncSearchVw, bool>> innerOrPredicate = PredicateBuilder.False<TdIncSearchVw>(); // for OR innerOrPredicate = innerOrPredicate.Or(i=> i.IncStatusInd.Equals(incStatus)); innerOrPredicate = innerOrPredicate.Or(i=> i.RqmtStatusInd.Equals(incStatus)); predicate = predicate.And(i => i.TmTec.Equals(tecTm)); predicate = predicate.And(i => i.TmsTec.Equals(series)); predicate = predicate.And(i => i.HistoryInd.Equals(historyInd)); predicate.And(innerOrPredicate); var query = repo.GetEnumerable(predicate); This results in SQL that completely ignores the 2 OR phrases. select x from TdIncSearchVw where ((this_."TM_TEC" = :p0 and this_."TMS_TEC" = :p1) and this_."HISTORY_IND" = :p2) If I try using just the OR phrases like: Expression<Func<TdIncSearchVw, bool>> innerOrPredicate = PredicateBuilder.False<TdIncSearchVw>(); // for OR innerOrPredicate = innerOrPredicate.Or(i=> i.IncStatusInd.Equals(incStatus)); innerOrPredicate = innerOrPredicate.Or(i=> i.RqmtStatusInd.Equals(incStatus)); var query = repo.GetEnumerable(innerOrPredicate); I get SQL as expected like: select X from TdIncSearchVw where (IncStatusInd = incStatus OR RqmtStatusInd = incStatus) If I try using just the AND phrases like: predicate = predicate.And(i => i.TmTec.Equals(tecTm)); predicate = predicate.And(i => i.TmsTec.Equals(series)); predicate = predicate.And(i => i.HistoryInd.Equals(historyInd)); var query = repo.GetEnumerable(predicate); I get SQL like: select x from TdIncSearchVw where ((this_."TM_TEC" = :p0 and this_."TMS_TEC" = :p1) and this_."HISTORY_IND" = :p2) which is exactly the same as the first query. It seems like I'm so close it must be something simple that I'm missing. Can anyone see what I'm doing wrong here? Thanks, Terry

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >