Search Results

Search found 99184 results on 3968 pages for 'no one in particular'.

Page 13/3968 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • NHibernate One to One Foreign Key ON DELETE CASCADE

    - by xll
    I need to implement One-to-one association between Project and ProjecSettings using fluent NHibernate: public class ProjectMap : ClassMap<Project> { public ProjectMap() { Id(x => x.Id) .UniqueKey(MapUtils.Col<Project>(x => x.Id)) .GeneratedBy.HiLo("NHHiLoIdentity", "NextHiValue", "1000", string.Format("[EntityName] = '[{0}]'", MapUtils.Table<Project>())) .Not.Nullable(); HasOne(x => x.ProjectSettings) .PropertyRef(x => x.Project); } } public class ProjectSettingsMap : ClassMap<ProjectSettings> { public ProjectSettingsMap() { Id(x => x.Id) .UniqueKey(MapUtils.Col<ProjectSettings>(x => x.Id)) .GeneratedBy.HiLo("NHHiLoIdentity", "NextHiValue", "1000", string.Format("[EntityName] = '[{0}]'", MapUtils.Table<ProjectSettings>())); References(x => x.Project) .Column(MapUtils.Ref<ProjectSettings, Project>(p => p.Project, p => p.Id)) .Unique() .Not.Nullable(); } } This results in the following sql for Project Settings: CREATE TABLE ProjectSettings ( Id bigint PRIMARY KEY NOT NULL, Project_Project_Id bigint NOT NULL UNIQUE, /* Foreign keys */ FOREIGN KEY (Project_Project_Id) REFERENCES Project() ON DELETE NO ACTION ON UPDATE NO ACTION ); What I am trying to achieve is to have ON DELETE CASCADE for the FOREIGN KEY (Project_Project_Id), so that when the project is deleted through sql query, it's settings are deleted too. How can I achieve this ? EDIT: I know about Cascade.Delete() option, but it's not what I need. Is there any way to intercept the FK statement generation?

    Read the article

  • Mercurial: applying changes one by one to resolve merging issues

    - by Webinator
    I recently tried to merge a series of changeset and encountered a huge number of merging issues. Hence I'd like to to try to apply each changeset, in order, one by one, in order to make the merging issues easier to manage. I'll give an example with 4 problematic changesets (514,515,516 and 517) [in my real case, I've got a bit more than that] o changeset: 517 | o changeset: 516 | o changeset: 515 | o changeset: 514 | | | @ changeset: 513 | | | o changeset: 512 | | | o | | | o | | | o |/ | | o changeset 508 Note that I've got clones of my repos before pulling the problematic changesets. When I pull the 4 changesets and try a merge, things are too complicated to resolve. So I wanted to pull only changeset 514, then merge. Then once I solve the merging issue, pull only changeset 515 and apply it, etc. (I know the numbering shall change, this is not my problem here). How am I supposed to do that, preferably without using any extension? (because I'd like to understand Mercurial and what I'm doing better). Is the way to go generate a patch between 508 and 514 and apply that patch? (if so, how would I generate that patch) Answers including concrete command-line example(s) most welcome :)

    Read the article

  • Strange JPA one-to-many behavior when trying to set the "many" on the "one" entity

    - by errr
    I've mapped two entities using JPA (specifically Hibernate). Those entities have a one-to-many relationship (I've simplified for presentation): @Entity public class A { @ManyToOne public B getB() { return b; } } @Entity public Class B { @OneToMany(mappedBy="b") public Set<A> getAs() { return as; } } Now, I'm trying to create a relationship between two instances of these entities by using the setter of the one-side/not-owner-side of the relationship (i.e the table being referenced to): em.getTransaction().begin(); A a = new A(); B b = new B(); Set<A> as = new HashSet<A>(); as.add(a); b.setAs(as); em.persist(a); em.persist(b); em.getTransaction().commit(); But then, the relationship isn't persisted to the DB (the row created for entity A isn't referencing the row created for entity B). Why is it so? I'd excpect it to work. Also, if I remove the "mappedBy" property from the @OneToMany annotation it will work. Again - why is it so? and what are the possible effects for removing the "mappedBy" property?

    Read the article

  • SQLAlchemy, one to many vs many to one

    - by sadvaw
    Dear Everyone, I have the following data: CREATE TABLE `groups` ( `bookID` INT NOT NULL, `groupID` INT NOT NULL, PRIMARY KEY(`bookID`), KEY( `groupID`) ); and a book table which basically has books( bookID, name, ... ), but WITHOUT groupID. There is no way for me to determine what the groupID is at the time of the insert for books. I want to do this in sqlalchemy. Hence I tried mapping Book to the books joined with groups on book.bookID=groups.bookID. I made the following: tb_groups = Table( 'groups', metadata, Column('bookID', Integer, ForeignKey('books.bookID'), primary_key=True ), Column('groupID', Integer), ) tb_books = Table( 'books', metadata, Column('bookID', Integer, primary_key=True), tb_joinedBookGroup = sql.join( tb_books, tb_groups, \ tb_books.c.bookID == tb_groups.c.bookID) and defined the following mapper: mapper( Group, tb_groups, properties={ 'books': relation(Book, backref='group') }) mapper( Book, tb_joinedBookGroup ) ... However, when I execute this piece of code, I realized that each book object has a field groups, which is a list, and each group object has books field which is a singular assigment. I think my definition here must have been causing sqlalchemy to be confused about the many-to-one vs one-to-many relationship. Can someone help me sort this out? My desired goal is g.books = [b, b, b, .. ] book.group = g, where g is an instance of group, and b is an instance of book

    Read the article

  • One-to-one Mapping issue with NHibernate/Fluent: Foreign Key not updateing

    - by Trevor
    Summary: Parent and Child class. One to one relationship between the Parent and Child. Parent has a FK property which references the primary key of the Child. Code as follows: public class NHTestParent { public virtual Guid NHTestParentId { get; set; } public virtual Guid ChildId { get { return ChildRef.NHTestChildId; } set { } } public virtual string ParentName { get; set; } protected NHTestChild _childRef; public virtual NHTestChild ChildRef { get { if (_childRef == null) _childRef = new NHTestChild(); return _childRef; } set { _childRef = value; } } } public class NHTestChild { public virtual Guid NHTestChildId { get; set; } public virtual string ChildName { get; set; } } With the following Fluent mappings: Parent Mapping Id(x => x.NHTestParentId); Map(x => x.ParentName); Map(x => x.ChildId); References(x => x.ChildRef, "ChildId").Cascade.All(); Child Mapping: Id(x => x.NHTestChildId); Map(x => x.ChildName); If I do something like (pseudo code) ... HTestParent parent = new NHTestParent(); parent.ParentName = "Parent 1"; parent.ChildRef.ChildName = "Child 1"; nhibernateSession.SaveOrUpdate(aParent); Commit; ... I get an error: "Invalid index 3 for this SqlParameterCollection with Count=3" If I change the parent 'References' line as follows (i.e. provide the name of the child property I'm pointing at): References(x => x.ChildRef, "ChildId").PropertyRef("NHTestChildId").Cascade.All(); I get the error: "Unable to resolve property: NHTestChildId" So, I tried the 'HasOne()' reference setting, as follows: HasOne<NHTestChild>(x => x.ChildRef).ForeignKey("ChildId").Cascade.All().Fetch.Join(); This results in the save working, but the load fails to find the child. If I inspect the SQL Nhibernate produces I can see that NHibernate is assuming the Primary key of the parent is the link to the child (i.e. load join condition is "parent.NHTestParentId = child.NHTestChildId). The 'ForeignKey' specified appears to be ignored. I can set any value and no error occurs - the join just always fails and no child is returned. I've tried a number of slight variations on the above. It seems like it should be a simple thing to achieve. Any ideas?

    Read the article

  • Storing Preferences/One-to-One Relationships in Database

    - by LnDCobra
    What is the best way to store settings for certain objects in my database? Method one: Using a single table Table: Company {CompanyID, CompanyName, AutoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter} Method two: Using two tables Table Company {CompanyID, COmpanyName} Table2 CompanySettings{CompanyID, utoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter}

    Read the article

  • Ruby on Rails: create records for multiple models with one form and one submit

    - by notblakeshelton
    I have a 3 models: quote, customer, and item. Each quote has one customer and one item. I would like to create a new quote, a new customer, and a new item in their respective tables when I press the submit button. I have looked at other questions and railscasts and either they don't work for my situation or I don't know how to implement them. I also want my index page to be the page where I can create everything. quote.rb class Quote < ActiveRecord::Base attr_accessible :quote_number has_one :customer has_one :item end customer.rb class Customer < ActiveRecord::Base #unsure of what to put here #a customer can have multiple quotes, so would i use: has_many :quotes #<----? end item.rb class Item < ActiveRecord::Base #also unsure about this #each item can also be in multiple quotes quotes_controller.rb class QuotesController < ApplicationController def index @quote = Quote.new @customer = Customer.new @item = item.new end def create @quote = Quote.new(params[:quote]) @quote.save @customer = Customer.new(params[:customer]) @customer.save @item = Item.new(params[:item]) @item.save end end items_controller.rb class ItemsController < ApplicationController def index end def new @item = Item.new end def create @item = Item.new(params[:item]) @item.save end end customers_controller.rb class CustomersController < ApplicationController def index end def new @customer = Customer.new end def create @customer = Customer.new(params[:customer]) @customer.save end end quotes/index.html.erb <%= form_for @quote do |f| %> <%= f.fields_for @customer do |builder| %> <%= label_tag :firstname %> <%= builder.text_field :firstname %> <%= label_tag :lastname %> <%= builder.text_field :lastname %> <% end %> <%= f.fields_for @item do |builder| %> <%= label_tag :name %> <%= builder.text_field :name %> <%= label_tag :description %> <%= builder.text_field :description %> <% end %> <%= label_tag :quote_number %> <%= f.text_field :quote_number %> <%= f.submit %> <% end %> When I try submitting that I get an error: Can't mass-assign protected attributes: item, customer So to try and fix it I updated the attr_accessible in quote.rb to include :item, :customer but then I get this error: Item(#) expected, got ActiveSupport::HashWithIndifferentAccess(#) Any help would be greatly appreciated.

    Read the article

  • ROOT_MISMATCH error after following FAQ directions

    - by Adko
    While using Ubuntu One in 11.04 I am unable to change my account info. When I made the switch to 11.04 I forgot that I already had an Ubuntu One account so, I made a new one. However, upon going through one of my email accounts I found my old Ubuntu One login information. I then attempted to switch the account associated with my desktop to my first email. Now, despite following the directions found at https://wiki.ubuntu.com/UbuntuOne/FAQ/WhatToDoWhenSyncdaemonSaysRootMismatch I continue to get the error "File sync error. (local and server roots are different (ROOT_MISMATCH))". Any help would be appreciated.

    Read the article

  • Does a mini PCIe SSD fit into a Acer Aspire One?

    - by Narcolapser
    Question: What, if any, mini PCIe SSDs fit into the mini PCIe slot of the Acer Aspire one AOD250? Info: I have an Aspire One and I've been considering loading it with an SSD. The mini PCIe drives fascinate me and so I want to try that approach. Also they tend to be cheaper and not much slower. (at least not on Read time which matters more for a netbook) But I've heard that some times computers don't support certain mini PCIe cards. And I was wondering if anyone knew about the Aspire One? I tried asking Acer tech support, but they didn't know jack and spent the whole time informing that I would have to support my Ubuntu install on my own, which I was. Anyway. Rant Aside, I'm looking at this drive: http://www.newegg.com/Product/Product.aspx?Item=N82E16820183252 It states it is exclusively for the Eee PC. now does that mean It was designed for the Eee PC but will work in my netbook. or is something going to go wrong? (like right now my concern is it physically not fitting.) Any information would be appreciated. o7

    Read the article

  • Two UIViews, one UIViewController (in one UINavigationController)

    - by jdandrea
    Given an iPhone app with a UITableViewController pushed onto a UINavigationController, I would like to add a right bar button item to toggle between the table view and an "alternate" view of the same data. Let's also say that this other view uses the same data but is not a UITableView. Now, I know variations on this question already exist on Stack Overflow. However, in this case, that alternate view would not be pushed onto the UINavigationController. It would be visually akin to flipping the current UIViewController's table view over and revealing the other view, then being able to flip back. In other words, it's intended to take up a single spot in the UINavigationController hierarchy. Moreover, whatever selection you ultimately make from within either view will push a common UIViewController onto the UINavigationController stack. Still more info: We don't want to use a separate UINavigationController just to handle this pair of views, and we don't want to split these apart via a UITabBarController either. Visually and contextually, the UX is meant to show two sides of the same coin. It's just that those two sides happen to involve their own View Controllers in normal practice. Now … it turns out I have already gone and quickly set this up to see how it might work! However, upon stepping back to examine it, I get the distinct impression that I went about it in a rather non-MVC way, which of course concerns me a bit. Here's what I did at a high level. Right now, I have a UIViewController (not a UITableViewController) that handles all commonalities between the two views, such as fetching the raw data. I also have two NIBs, one for each view, and two UIView objects to go along with them. (One of them is a UITableView, which is a kind of UIView.) I switch between the views using animation (easy enough). Also, in an effort to keep things encapsulated, the now-split-apart UITableView (not the UIViewController!) acts as its own delegate and data source, fetching data from the VC. The VC is set up as a weak, non-retained object in the table view. In parallel, the alternate view gets at the raw data from the VC in the exact same way. So, there are a few things that smell funny here. The weak linking from child to parent, while polite, seems like it might be wrong. Making a UITableView the table's data source and delegate also seems odd to me, thinking that a view controller is where you want to put that per Apple's MVC diagrams. As it stands now, it would appear as if the view knows about the model, which isn't good. Loading up both views in advance also seems odd, because lazy loading is no longer in effect. Losing the benefits of a UITableViewController (like auto-scrolling to cells with text fields) is also a bit frustrating, and I'd rather not reinvent the wheel to work around that as well. Given all of the above, and given we want that "flip effect" in the context of a single spot on a single UINavigationController, and given that both views are two sides of the same coin, is there a better, more obvious way to design this that I'm just happening to miss completely? Clues appreciated!

    Read the article

  • how to get the result query one by one in jsp and mysql

    - by user261002
    I am trying to implement as Online Mock exam in JSP, but I have a problem to get the questions one by one, it get connceted for the first time, and show me the first question and answers, but when I click on "next" again, it still show me the first question, I think by clicking on "next" it start querying again. please help me. this is my bean : database.SQLSelectStatement sqlselect; database.SQLSelectStatement sqlselect2; static ResultSet questions; static ResultSetMetaData rsm; static ResultSet answers; public void setConnection() throws SQLException { if (database.DatabaseManager.getInstance().connectionOK()) { sqlselect = new database.SQLSelectStatement("question", "question", "0"); sqlselect2 = new database.SQLSelectStatement("answers", "question_id", "0"); questions = sqlselect.executeWithNoCondition(); } } public int i=0; public String getQuestions() throws SQLException { String result = ""; rsm = questions.getMetaData(); for (int i = 0; i < rsm.getColumnCount(); i++) { result += "<th>" + rsm.getColumnName(i + 1) + "</th>"; } if (!questions.isLast()) { questions.next(); System.out.println(i+1); result += "<tr>"; result += "<td>" + questions.getInt(1) + "</td>"; result += "<td>" + questions.getString(2) + "</td>"; result += "</tr>"; result += "<tr>"; sqlselect2.setValue(String.valueOf(questions.getInt(1))); answers = sqlselect2.Execute(); while (answers.next()) { result += "<tr> <td colspan='2'><input type='radio' name='answer' value='" + answers.getString(2) + "'> " + answers.getString(2) + "</td></tr>"; } result += "</tr>"; answers.close(); } return result; } this is the HTML: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>JSP Page</h1> <jsp:useBean id="exam" class="exam.ExamQuestions"></jsp:useBean> <% exam.setConnection(); %> <form method="post"> <table > <%=exam.getQuestions()%> </table> <input type="submit" name="action" value="next"/> </form> <% String action = request.getParameter("action"); if ("next".equals(action)) { out.println(request.getParameter("answer")); } %> </body> </html>

    Read the article

  • Does HashMap provide a one to one correspondence?

    - by Roman
    I found the following statement: Map is an object that stores key/volume pairs. Given a key, you can find its value. Keys must be unique, but values may be duplicated. For example I have just one key/value pair (3,4). And now I put a new pair (3,5). It will remove the old pair. Right? But if I put (2,4) instead of (3,4) I will add a new pair of key/value to the HashMap. Right?

    Read the article

  • C++: Most common way to talk to one application from the other one

    - by MInner
    In bare outlines, I've got an application which looks through the directories at startup and creates special files' index - after that it works like daemon. The other application creates such 'special' files and places them in some directory. What way of informing the first application about a new file (to index it) is the most common, simple (the first one is run-time, so it shouldn't slow it too much), and cross-platform if it is possible? I've looked through RPC and IPC but they are too heavy (also non-cross-platform and slow (need a lot of features to work - I need a simple light well-working way), probably).

    Read the article

  • Selecting one object from a one-to-many relationship in Hibernate

    - by Nick Thomson
    I have two tables: Job job_id, <other data> Job_Link job_link_id, job_id, start_timestamp, end_timestamp, <other data> There may be multiple records in Job_Link specifying the same job_id with the start_timestamp and end_timestamps to indicate when those records are considered "current", it is guaranteed that start_timestamp and end_timestamp will not overlap. We have entities for both the Job and Job_Link tables and defining a one-to-many relationship to load all the job_links wouldn't be a problem. However we'd like to avoid that and have a single job_link item in the Job entity that will contain only the "current" Job_Link object. Is there any way to achive that?

    Read the article

  • Identifying languages used by particular industries

    - by user66146
    I am new to programming and I don't know the differences between the major languages. I desperately want to get into the gaming industry because I have so many stories I want to tell and so many experiences I want to create. I currently do 3D modeling/animation, so any similarities would be helpful. What steps should I take to investigate an industry (gaming) and the companies within that industry? How do I identify what programming languages they use, so I can study them?

    Read the article

  • OS Development. Only Few Particular Questions

    - by Total Anime Immersion
    I am new to this site as a member but have consulted its answers quite a lot of times. Besides my questions regarding OS Development hasn't been answered in any forum. In OS Dev. we make a bootloader. The org point is 7C00H. Why so? Why not 0000h? What are the last two signatures in the bootloader used for? People on every forum have answered that it is important for the system to recognize it as a bootable media. But I want a specific answer. What do each of those signatures do. I have the basic concept of a kernel. Point is.. it relates to different files required in a system. It sort of binds up everything that is individually developed. Now the thing is that that I have floating ideas in my mind regarding different aspects like keyboard, mouse, etc.. how do I put them all together? Which should I start with first? If possible please provide a step by step procedure of the startups of the kernel. Suppose I have developed my language entirely in C and Assembly. Now questions is will exe files work on my system.. if it doesn't then I have to create my own files and publish them. Which is a bad idea.. next step would be for me to go for a compiler for a language which I have designed myself. Now the point is.. How do I implement the compiler into my OS? After all this my final question is that.. How do you go about multitasking and multithreading? and I don't want to use int 21h as its dos specific.. how do I go about making files, renaming them, etc. and all assembly books teach 16 but programming.. how do i go about doing 32 bit or 64 bit with the knowledge I have.. if the basics and instructions are the same.. I don't mind.. but how do i go about otherwise? Don't tell me to give up the idea because I WON'T. And don't tell me it's too complex because I have a sharp knowledge of working of a system, C, Java, Assembly, C++ and python, C#, visual basic.. and not just basics but full fledged api developments.. but I really want to go deep into the systems part.. so I want professional help.. And I have gone through many OS project files but I want help particularly from this site as there are people with knowledge depth who can guide me the right way. And please don't suggest any books above 20$ and they should be available on flipkart as amazon charges massively for shipping and I prefer free shipping from flipkart.

    Read the article

  • Are Motherboards for the Acer Aspire One AOA150 Netbook Compatible with the AOA110?

    - by Mindstormscreator
    I have an Acer Aspire One ZG5 AOA110-1588 netbook, and the motherboard doesn't have a port for a SATA 2.5 inch hard drive; it only supports this slow 8GB SSD type drive. Through research I've discovered that the AOA150 motherboards do have a SATA slot, and the bottom plate of these laptops have an appropriate protrusion for the drive to fit in (for example, compare this to this). The AOA110 and AOA150 models are very similar in appearance and specs. I've even seen tutorials that involve soldering a SATA connector onto the AOA110's motherboard, essentially creating an AOA150 motherboard (right?) So, could I just swap out the motherboard in my netbook with the MBS0506001? (I'd post another link to the actual board but can't because of the spam prevention...) I assume I would also need to purchase and replace the bottom cover with a larger one and possibly get a hard drive caddy as well...? Thanks!

    Read the article

  • Unable to Connect to Internet with 3G USB Dongle for Particular ISP

    - by Kush
    I'm using USB 3G Dongle for Internet. Previously I was using Tata Docomo (India) as provider, and the Internet was working fine. Now I've changed to BSNL, but I'm unable to connect to the Internet on Ubuntu. However, I've checked access point settings and other configuration which are required for BSNL, and it is working fine with same Dongle on Windows 7. Also, I'm able to connect Internet with other providers on Ubuntu, but problem persists only with Ubuntu. The access point for BSNL in my region is bsnlnet. In fact I configure the Dongle with BSNL using default Network Configuration wizard that pops up when USB Dongle is attached. When Dongle is attached and configured with BSNL, I can see network strength in Messaging menu, in Mobile Broadband category, of Ubuntu (note: my network icon still shows "not connected" status). And when I try to use the connection that I've created, it fails to connect. So far, I tried using Sakis3g script that I came up with while wandering over this issue on other forums, it didn't worked either. I also made sure that there are no special configuration made for BSNL on my Windows 7 installation, and still it is working fine there, the problem is only with Ubuntu. How can I fix it?

    Read the article

  • How to connect to a PEAP GTC wifi network with Android 2.2 on a nexus one?

    - by Glen
    Hi, I recently updated my nexus one to 2.2. Now I can't connect to my uni's wifi. They use PEAP with GTC. I had it working fine on 2.1. Also it works fine on my Ubuntu laptop. I have entered my uni number (user name) in the identity box. I have entered my password in the password box. I have emailed the certificated that works on Ubuntu to my self and installed it on the nexus one. I have enabled secure credentials. What am I doing wrong? Thanks, Glen.

    Read the article

  • Detect collision from a particular side

    - by Fabián
    I'm making a platform sidescrolling game. All I want to do is to detect if my character is on the floor: function OnCollisionStay (col : Collision){ if(col.gameObject.tag == "Floor"){ onFloor = true; } else {onFloor = false;} } function OnCollisionExit (col : Collision){ onFloor = false; } But I know this isn't the accurate way. If I hit a cube with a "floor" tag, in the air (no matter if with the character's feet or head) I would be able to jump. Is there a way to use the same box collision to detect if I'm touching something from a specific side?

    Read the article

  • Why my site is not ranking for particular keyword

    - by user543087
    My site is only 3 days to be 6 months old. This website is unique, that is there is no competitor to this type site in India, providing comparison of payment gateways in India, besides the payment gateways companies itself. I've optimized it for key word : "payment gateway" I've changed the url's twice, latest being 3 months back, in which case Google Webmaster gave plently of 404's. I corrected the useful 404's and left meaningless ones as it is. What is the reason it's not ranking well for payment gateways? Even site with single page about "Payment gateways" seem to be ranking better than this. Is it does to: 1) Lot of outbound links to in-context companies and information 2) 404's as reported in Google Webmaster My another site is successfully getting 1500 unique visitors daily and is up in Google ranking. I don't know why it is not!

    Read the article

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