Search Results

Search found 2412 results on 97 pages for 'relationship'.

Page 17/97 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • MySQL: List rows who have one but not another many-to-many relationship

    - by Svish
    Not quite sure how to ask or define this, but can't figure it out. I have three tables like this: persons person_id, first_name, last_name hobbies hobby_id, name persons_hobbies person_id, hobby_id I need to make two lists. Persons that have both hobby A and B, and persons that have hobby A but not B. How can I write these two queries? Can't figure out how to do this with joining and all...

    Read the article

  • 1:M relationship in Hibernate and cascading operations

    - by EugeneP
    Table SUBCOURSE references COURSE COURSE(id, name) SUBCOURSE(id, course_id, name) So, 1:M. Hibernate generates for Course: @OneToMany(fetch = FetchType.LAZY, mappedBy = "course", cascade = CascadeType.ALL) public Set getSubCourses() { return this.subCourses; } for Subcourse it generates @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "course_id", nullable = false) public Course getCourse() { return this.course; } Now the problem is that cascading does not work as expected. I want to create a collection of SubCourse objects (Set), fill it and then bind it to setSubCourses() of Course object. Though, having ManyToOne thing in a Subcourses table, I need to manually setCourse() before adding to collection on each object. If I do not do so, an exception is raised. What can you recommend me?

    Read the article

  • many-to-many relationship in CI (not using ORM)

    - by Ross
    I'm implementing a categories system in my CI app and trying to work out the best way of working with many to many relationships. I'm not using an ORM at this stage, but could use say Doctrine if necessary. Each entry may have multiple categories. I have three tables (simplified) Entries: entryID, entryName Categories: categoryID, categoryname Entry_Category: entryID, categoryID my CI code returns a record set like this: entryID, entryName, categoryID, categoryName but, as expected with Many-to-Many relationships, each "entry" is repeated for each "category". What would the best way to "group" the categories so that when I output the results, I am left with something like: Entry Name Appears in Category: Foo, Bar rather than: Entry Name Appears in Category: Foo Entry Name Appears in Category: Bar I believe the option is to track if the post ID matches a previous entry, and if so, store the respective category, and output it as one, rather than several, but am unsure of how to do this in CI. thanks for any pointers (I appreciate this is may be a vague/complex question without a better knowledge of the system).

    Read the article

  • Rails - column not found for defined 'has_many' relationship

    - by Guanlun
    I define a Post class which can link or be linked to multiple posts. To do this I added a PostLink class which specifies post_to and post_from. I generated the PostLink class by rails g model post_link from_post:integer to_post:integer and of course rake db:migrate, and added belongs_to :from_post, :class_name => 'Post' belongs_to :to_post, :class_name => 'Post' to the class. And I also have has_many :post_links in my Post class. I ran rails console and Post.new.post_links and got nil printed out, which is expected. However after I save a Post using p = Post.new p.save and then run p.post_links, it prints out the following error message: SQLite3::SQLException: no such column: post_links.post_id: SELECT "post_links".* FROM "post_links" WHERE "post_links"."post_id" = 1 So anybody know why after saving it to the database post_link can not be accessed?

    Read the article

  • Entity Framework - Merging 2 physical tables into one "virtual" table problems...

    - by Keith Barrows
    I have been reading up on porting ASP.NET Membership Provider into .NET 3.5 using LINQ & Entities. However, the DB model that every single sample shows is the newer model while I've inherited a rather old model. Differences: The User Table is split into a pair of User & Membership Tables. All of the tables in the DB are prepended with aspnet_ I have Lowered versions of some columns (UserName, Email, etc) To work with this I have copied the properties from the Membership table into the User table (in the DB this is a 1<-1 relationship, not a 1<-0,1), renamed aspnet_Applications to Application, aspnet_Profiles to Profile, aspnet_Users to User and aspnet_Roles to Role. (See image) Link to full size image of model Now, I am running into one of 2 problems when I try to compile. Using the model in the image I get this error: Problem in Mapping Fragment starting at line 464: EntitySets 'UserSet' and 'aspnet_Membership' are both mapped to table 'aspnet_Membership'. Their Primary Keys may collide. If I delete the aspnet_Membership table from my model (to handle the above error) I then get: Problem in Mapping Fragment starting at line 384: Column aspnet_Membership.ApplicationId in table aspnet_Membership must be mapped: It has no default value and is not nullable. My ability to hand edit the backing stores is not the best and I don't want to just hack something in that may break other things. I am looking for suggestions, best practices, etc to handle this. Note: Moving the data tables themselves is not an option as I cannot replace all the logic in the existing apps. I am building this EF Provider for a new App. Over the next 6 months the old app(s) will migrate bit-by-bit to the new structures. Note: I added a link just under the image to the full size image for better viewing.

    Read the article

  • Save has_and_belongs_to_many link in basic RoR app

    - by Stéphane V
    I try to learn the has_and_belongs_to_many relationship between my 2 fresh new and simple models Product and Author, where a Product can have many authors and where author can have a lots of products. I wrote this : class Author < ActiveRecord::Base has_and_belongs_to_many :products end class Product < ActiveRecord::Base has_and_belongs_to_many :authors end In the partial form of view for the products, I have : <p>Products</p> <%= collection_select(:product, :author_ids, @authors, :id, :name, :prompt => " ", :multiple => true) %> but when I hit the update button, I get this strange message I can't resolve myself : NoMethodError in ProductsController#update undefined method `reject' for "1":String Rails.root: /home/stephane/www/HABTM Application Trace | Framework Trace | Full Trace app/controllers/products_controller.rb:63:in block in update' app/controllers/products_controller.rb:62:inupdate' Request Parameters: {"utf8"="✓", "_method"="put", "authenticity_token"="2GlTssOFjTVZ9BikrIFgx22cdTOIJuAB70liYhhLf+4=", "product"={"title"="Le trésor des Templiers", "original_title"="", "number"="1", "added_by"="", "author_ids"="1"}, "commit"="Update Product", "id"="1"} What's wrong ? Is there a problem with :product_ids... I saw on internet I had to pu a "s" but I'm not sure of what it represents.... How can I link the table authors_products to the key which is given back by the drop-down menu ? (here "author_ids"="1") Thx !

    Read the article

  • Doctrine 1.2: How do i prevent a contraint from being assigned to both sides of a One-to-many relati

    - by prodigitalson
    Is there a way to prevent Doctrine from assigning a contraint on both sides of a one-to-one relationship? Ive tried moving the definition from one side to the other and using owning side but it still places a constraint on both tables. when I only want the parent table to have a constraint - ie. its possible for the parent to not have an associated child. For example iwant the following sql schema essentially: CREATE TABLE `parent_table` ( `child_id` varchar(50) NOT NULL, `id` integer UNSIGNED NOT NULL auto_increment, PRIMARY KEY (`id`) ); CREATE TABLE `child_table` ( `id` integer UNSIGNED NOT NULL auto_increment, `child_id` varchar(50) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY (`child_id`), CONSTRAINT `parent_table_child_id_FK_child_table_child_id` FOREIGN KEY (`child_id`) REFERENCES `parent_table` (`child_id`) ); However im getting something like this: CREATE TABLE `parent_table` ( `child_id` varchar(50) NOT NULL, `id` integer UNSIGNED NOT NULL auto_increment, PRIMARY KEY (`id`), CONSTRAINT `child_table_child_id_FK_parent_table_child_id` FOREIGN KEY (`child_id`) REFERENCES `child_table` (`child_id`) ); CREATE TABLE `child_table` ( `id` integer UNSIGNED NOT NULL auto_increment, `child_id` varchar(50) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY (`child_id`), CONSTRAINT `parent_table_child_id_FK_child_table_child_id` FOREIGN KEY (`child_id`) REFERENCES `parent_table` (`child_id`) ); I could just remove the constraint manually or modify my accessors to return/set a single entity in the collection (using a one-to-many) but it seems like there should built in way to handle this. Also im using Symfony 1.4.4 (pear installtion ATM) - in case its an sfDoctrinePlugin issue and not necessarily Doctrine itself.

    Read the article

  • Which Table Should be Master and Child in Database Design

    - by Jason
    I am quickly learning the ins and outs of database design (something that, as of a week ago, was new to me), but I am running across some questions that don't seem immediately obvious, so I was hoping to get some clarification. The question I have right is about foreign keys. As part of my design, I have a Company table. Originally, I had included address information directly within the table, but, as I was hoping to achieve 3NF, I broke out the address information into its own table, Address. In order to maintain data integrity, I created a row in Company called "addressId" as an INT and the Address table has a corresponding addressId as its primary key. What I'm a little bit confused about (or what I want to make sure I'm doing correctly) is determining which table should be the master (referenced) table and which should be the child (referencing) table. When I originally set this up, I made the Address table the master and the Company the child. However, I now believe this is wrong due to the fact that there should be only one address per Company and, if a Company row is deleted, I would want the corresponding Address to be removed as well (CASCADE deletion). I may be approaching this completely wrong, so I would appreciate any good rules of thumb on how to best think about the relationship between tables when using foreign keys. Thanks!

    Read the article

  • Does Hibernate support one-to-one associations as pkeys?

    - by Andrzej Doyle
    Hi all, Can anyone tell me whether Hibernate supports associations as the pkey of an entity? I thought that this would be supported but I am having a lot of trouble getting any kind of mapping that represents this to work. In particular, with the straight mapping below: @Entity public class EntityBar { @Id @OneToOne(optional = false, mappedBy = "bar") EntityFoo foo // other stuff } I get an org.hibernate.MappingException: "Could not determine type for: EntityFoo, at table: ENTITY_BAR, for columns: [org.hibernate.mapping.Column(foo)]" Diving into the code it seems the ID is always considered a Value type; i.e. "anything that is persisted by value, instead of by reference. It is essentially a Hibernate Type, together with zero or more columns." I could make my EntityFoo a value type by declaring it serializable, but I wouldn't expect this would lead to the right outcome either. I would have thought that Hibernate would consider the type of the column to be integer (or whatever the actual type of the parent's ID is), just like it would with a normal one-to-one link, but this doesn't appear to kick in when I also declare it an ID. Am I going beyond what is possible by trying to combine @OneToOne with @Id? And if so, how could one model this relationship sensibly?

    Read the article

  • Symfony: embedRelation() controlling options for nesting multiple levels of relations

    - by wulftone
    Hey all, I'm trying to set some conditional statements for nested embedRelation() instances, and can't find a way to get any kind of option through to the second embedRelation. I've got a "Measure-Page-Question" table relationship, and I'd like to be able to choose whether or not to display the Question table. For example, say I have two "success" pages, page1Success.php and page2Success.php. On page1, I'd like to display "Measure-Page-Question", and on page2, I'd like to display "Measure-Page", but I need a way to pass an "option" to the PageForm.class.php file to make that kind of decision. My actions.class.php file has something like this: // actions.class.php $this-form = new measureForm($measure, array('option'=$option)); to pass an option to the "Page", but passing that option through "Page" into "Question" doesn't work. My measureForm.class.php file has an embedRelation in it that is dependent on the "option": // measureForm.class.php if ($this-getOption('option') == "page_1") { $this-embedRelation('Page'); } and this is what i'd like to do in my pageForm.class.php file: // pageForm.class.php if ($this-getOption('option') == "page_1") { // Or != "page_2", or whatever $this-embedRelation('Question'); } I can't seem to find a way to do this. Any ideas? Is there a preferred Symfony way of doing this type of operation, perhaps without embedRelation? Thanks, -Trevor As requested, here's my schema.yml: # schema.yml Measure: connection: doctrine tableName: measure columns: _kp_mid: type: integer(4) fixed: false unsigned: false primary: true autoincrement: true description: type: string() fixed: false unsigned: false primary: false notnull: false autoincrement: false frequency: type: integer(4) fixed: false unsigned: false primary: false notnull: false autoincrement: false relations: Page: local: _kp_mid foreign: _kf_mid type: many Page: connection: doctrine tableName: page columns: _kp_pid: type: integer(4) fixed: false unsigned: false primary: true autoincrement: true _kf_mid: type: integer(4) fixed: false unsigned: false primary: false notnull: false autoincrement: false next: type: string() fixed: false unsigned: false primary: false notnull: false autoincrement: false number: type: string() fixed: false unsigned: false primary: false notnull: false autoincrement: false previous: type: string() fixed: false unsigned: false primary: false notnull: false autoincrement: false relations: Measure: local: _kf_mid foreign: _kp_mid type: one Question: local: _kp_pid foreign: _kf_pid type: many Question: connection: doctrine tableName: question columns: _kp_qid: type: integer(4) fixed: false unsigned: false primary: true autoincrement: true _kf_pid: type: integer(4) fixed: false unsigned: false primary: false notnull: false autoincrement: false text: type: string() fixed: false unsigned: false primary: false notnull: false autoincrement: false type: type: integer(4) fixed: false unsigned: false primary: false notnull: false autoincrement: false relations: Page: local: _kf_pid foreign: _kp_pid type: one

    Read the article

  • Creating A SharePoint Parent/Child List Relationship&ndash; SharePoint 2010 Edition

    - by Mark Rackley
    Hey blog readers… It has been almost 2 years since I posted my most read blog on creating a Parent/Child list relationship in SharePoint 2007: Creating a SharePoint List Parent / Child Relationship - Out of the Box And then a year ago I improved on my method and redid the blog post… still for SharePoint 2007: Creating a SharePoint List Parent/Child Relationship – VIDEO REMIX Since then many of you have been asking me how to get this to work in SharePoint 2010, and frankly I have just not had time to look into it. I wish I could have jumped into this sooner, but have just recently began to look at it. Well.. after all this time I have actually come up with two solutions that work, neither of them are as clean as I’d like them to be, but I wanted to get something in your hands that you can start using today. Hopefully in the coming weeks and months I’ll be able to improve upon this further and give you guys some better options. For the most part, the process is identical to the 2007 process, but you have probably found out that the list view web parts in 2010 behave differently, and getting the Parent ID to your new child form can be a pain in the rear (at least that’s what I’ve discovered). Anyway, like I said, I have found a couple of solutions that work. If you know of a better one, please let us know as it bugs me that this not as eloquent as my 2007 implementation. Getting on the same page First thing I’d recommend is recreating this blog: Creating a SharePoint List Parent/Child Relationship – VIDEO REMIX in SharePoint 2010… There are some vague differences, but it’s basically the same…  Here’s a quick video of me doing this in SP 2010: Creating Lists necessary for this blog post Now that you have the lists created, lets set up the New Time form to use a QueryString variable to populate the Parent ID field: Creating parameters in Child’s new item form to set parent ID Did I talk fast enough through both of those videos? Hopefully by now that stuff is old hat to you, but I wanted to make sure everyone could get on the same page.  Okay… let’s get started. Solution 1 – XSLTListView with Javascript This solution is the more elegant of the two, however it does require the use of a little javascript.  The other solution does not use javascript, but it also doesn’t use the pretty new SP 2010 pop-ups.  I’ll let you decide which you like better. The basic steps of this solution are: Inserted a Related Item View Insert a ContentEditorWebPart Insert script in ContentEditorWebPart that pulls the ID from the Query string and calls the method to insert a new item on the child entry form Hide the toolbar from data view to remove “add new item” link. Again, you don’t HAVE to use a CEWP, you could just put the javascript directly in the page using SPD.  Anyway, here is how I did it: Using Related Item View / JavaScript Here’s the JavaScript I used in my Content Editor Web Part: <script type="text/javascript"> function NewTime() { // Get the Query String values and split them out into the vals array var vals = new Object(); var qs = location.search.substring(1, location.search.length); var args = qs.split("&"); for (var i=0; i < args.length; i++) { var nameVal = args[i].split("="); var temp = unescape(nameVal[1]).split('+'); nameVal[1] = temp.join(' '); vals[nameVal[0]] = nameVal[1]; } var issueID = vals["ID"]; //use this to bring up the pretty pop up NewItem2(event,"http://sp2010dev:1234/Lists/Time/NewForm.aspx?IssueID=" + issueID); //use this to open a new window //window.location="http://sp2010dev:1234/Lists/Time/NewForm.aspx?IssueID=" + issueID; } </script> Solution 2 – DataFormWebPart and exact same 2007 Process This solution is a little more of a hack, but it also MUCH more close to the process we did in SP 2007. So, if you don’t mind not having the pretty pop-up and prefer the comforts of what you are used to, you can give this one a try.  The basics steps are: Insert a DataFormWebPart instead of the List Data View Create a Parameter on DataFormWebPart to store “ID” Query String Variable Filter DataFormWebPart using Parameter Insert a link at bottom of DataForm Web part that points to the Child’s new item form and passes in the Parent Id using the Parameter. See.. like I told you, exact same process as in 2007 (except using the DataFormWeb Part). The DataFormWebPart also requires a lot more work to make it look “pretty” but it’s just table rows and cells, and can be configured pretty painlessly.  Here is that video: Using DataForm Web Part One quick update… if you change the link in this solution from: <tr> <td><a href="http://sp2010dev:1234/Lists/Time/NewForm.aspx?IssueID={$IssueIDParam}">Click here to create new item...</a> </td> </tr> to: <tr> <td> <a href="javascript:NewItem2(event,'http://sp2010dev:1234/Lists/Time/NewForm.aspx?IssueID={$IssueIDParam}');">Click here to create new item...</a> </td> </tr> It will open up in the pretty pop up and act the same as solution one… So… both Solutions will now behave the same to the end user. Just depends on which you want to implement. That’s all for now… Remember in both solutions when you have them working, you can make the “IssueID” invisible to users by using the “ms-hidden” class (it’s my previous blog post on the subject up there). That’s basically all there is to it! No pithy or witty closing this time… I am sorry it took me so long to dive into this and I hope your questions are answered. As I become more polished myself I will try to come up with a cleaner solution that will make everyone happy… As always, thanks for taking the time to stop by.

    Read the article

  • How to define an n-m relation in doctrine?

    - by murze
    If got a table "Article" and a table "Tags". Articles can have multiple tags and tags can hang to multiple articles. The class BaseArticle looks like this: abstract class BaseArticle extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('article'); $this->hasColumn('article_id', 'integer', 8, array( 'type' => 'integer', 'length' => 8, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('title', 'string', null, array( 'type' => 'string', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, )); $this->hasColumn('text', 'string', null, array( 'type' => 'string', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, $this->hasColumn('url', 'string', 255, array( 'type' => 'string', 'length' => 255, 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, )); } public function setUp() { parent::setUp(); $this->hasMany('Tag as Tags', array( 'local' => 'article_id', 'foreign'=>'tag_id', 'refClass'=>'Articletag') ); } } The BaseTag-class like this: abstract class BaseTag extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('tag'); $this->hasColumn('tag_id', 'integer', 4, array( 'type' => 'integer', 'length' => 4, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('name', 'string', null, array( 'type' => 'string', 'fixed' => false, 'unsigned' => false, 'primary' => false, 'notnull' => false, 'autoincrement' => false, )); } public function setUp() { parent::setUp(); $this->hasMany('Article as Articles', array( 'local' => 'tag_id', 'foreign'=>'article_id', 'refClass'=>'Articletag') ); } } And the relationship class like this: abstract class BaseArticletag extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('articletag'); $this->hasColumn('article_id', 'integer', 8, array( 'type' => 'integer', 'length' => 8, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, )); $this->hasColumn('tag_id', 'integer', 4, array( 'type' => 'integer', 'length' => 4, 'fixed' => false, 'unsigned' => false, 'primary' => true, 'autoincrement' => false, )); } public function setUp() { parent::setUp(); } } When I try to get a property from the article all goes well by using: $article = Doctrine_Query::create()->from('Article a') ->where('id = ?' , 1) ->fetchOne(); echo $article->title; //gives me the title But when I try this: foreach($article->Tags as $tag) { echo($tag->name) } I get an error: Unknown record property / related component "Tags" on "Article"

    Read the article

  • Spotlight on Oracle Social Relationship Management. Social Enable Your Enterprise with Oracle SRM.

    - by Pat Ma
    Facebook is now the most popular site on the Internet. People are tweeting more than they send email. Because there are so many people on social media, companies and brands want to be there too. They want to be able to listen to social chatter, engage with customers on social, create great-looking Facebook pages, and roll out social-collaborative work environments within their organization. This is where Oracle Social Relationship Management (SRM) comes in. Oracle SRM is a product that allows companies to manage their presence with prospects and customers on social channels. Let's talk about two popular use cases with Oracle SRM. Easy Publishing - Companies now have an average of 178 social media accounts - with every product or geography or employee group creating their own social media channel. For example, if you work at an international hotel chain with every single hotel creating their own Facebook page for their location, that chain can have well over 1,000 social media accounts. Managing these channels is a mess - with logging in and out of every account, making sure that all accounts are on brand, and preventing rogue posts from destroying the brand. This is where Oracle SRM comes in. With Oracle Social Relationship Management, you can log into one window and post messages to all 1,000+ social channels at once. You can set up approval flows and have each account generate their own content but that content must be approved before publishing. The benefits of this are easy social media publishing, brand consistency across all channels, and protection of your brand from inappropriate posts. Monitoring and Listening - People are writing and talking about your company right now on social media. 75% of social media users have written a negative post about a brand after a poor customer service experience. Think about all the negative posts you see in your Facebook news feed about delayed flights or being on hold for 45 minutes. There is so much social chatter going on around your brand that it's almost impossible to keep up or comprehend what's going on. That's where Oracle SRM comes in. With Social Relationship Management, a company can monitor and listen to what people are saying about them on social channels. They can drill down into individual posts or get a high level view of trends and mentions. The benefits of this are comprehending what's being said about your brand and its competitors, understanding customers and their intent, and responding to negative posts before they become a PR crisis. Oracle SRM is part of Oracle Cloud. The benefits of cloud deployment for customers are faster deployments, less maintenance, and lower cost of ownership versus on-premise deployments. Oracle SRM also fits into Oracle's vision to social enable your enterprise. With Oracle SRM, social media is not just a marketing channel. Social media is also mechanism for sales, customer support, recruiting, and employee collaboration. For more information about how Oracle SRM can social enable your enterprise, please visit oracle.com/social. For more information about Oracle Cloud, please visit cloud.oracle.com.

    Read the article

  • Symfony2 same form, different entities NOT related

    - by user1381537
    I'm trying to write one form for submitting against MySQL DB, but I can't get it working, I've tried a lot of things (separate forms, create an ->add('foo', new foo()) to a field, and trying to parse plain SQL with a normal HTML form is my only solution, which is obviously not the best. This is my DB structure: As you can see I need to insert the comments textarea to ticketcomments among the user who wrote it, etc. On crmentity the description field. Then on ticketcf the fields that I need to submit from form, are this (because you wont know if I don't tell you because of the field names): tcf.cf594 AS Type, tcf.cf675 AS Suscription, tcf.cf770 AS ID_PRODUCT, tcf.cf746 AS NotificationDate, tcf.cf747 AS ResponseDate, tcf.cf748 AS ResolutionDate, And, of course, every table needs to have the same ticketid id for the submitted form, so we can retrieve it with one simple query. It will be easy to do with plain SQL instead of using DQL and Symfony2 forms, but is not a good way to do it. Also, here's my "Ticket list" query, if you need it to have it more clear... SELECT t.ticketNo AS Ticket, t.title AS Asunto, t.status AS Estado, t.updateLog AS LOG, t.hours AS Horas, t.solution AS Solucion, t.priority AS Prioridad, tcf.cf594 AS Tipo, tcf.cf675 AS Suscripcion, tcf.cf770 AS IDPROD, tcf.cf746 AS F_Noti, tcf.cf747 AS F_Resp, tcf.cf748 AS F_Reso, CONCAT (cd.firstname, cd.lastname) AS Contacto, crm.description AS Descripcion, crm.crmid AS id FROM WbsGoclientsBundle:VtigerTroubletickets t INNER JOIN WbsGoclientsBundle:VtigerTicketcf tcf WITH t.ticketid = tcf.ticketid INNER JOIN WbsGoclientsBundle:VtigerContactdetails cd WITH t.parentId = cd.contactid INNER JOIN WbsGoclientsBundle:VtigerCrmentity crm WITH t.ticketid = crm.crmid WHERE t.parentId IN ( SELECT cd1.contactid FROM WbsGoclientsBundle:VtigerContactdetails cd1 WHERE cd1.accountid = ( SELECT cd2.accountid FROM WbsGoclientsBundle:VtigerContactdetails cd2 WHERE cd2.contactid = :contactid)) AND t.status <> \'Closed\' And also "Ticket details" query (which is not in DQL format yet, only SQL) is so simple, it only retrieve the comments field and createdtime from ticketcomments appended to this query so we have all the fields... Thank you. This is a test form, using troubletickets and ticketcomments, it's returning errores because I can't set a comments field because troubletickets doesn't has it, but I need that field to be submitted to ticketcomments ... VtigerTicketcommentsType <?php namespace WbsGo\clientsBundle\Form\Type; use Symfony\Component\Form\AbstractType, Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class VtigerTicketcommentsType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('ticketid') ->add('comments') ->add('ownerid') ->add('ownertype') ->add('createdtype') ; } public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'WbsGo\clientsBundle\Entity\VtigerTicketcomments' )); } public function getName() { return 'comments'; } } OpenTicketType.php <?php namespace WbsGo\clientsBundle\Form; use Symfony\Component\Form\AbstractType, Symfony\Component\Form\FormBuilderInterface ; use WbsGo\clientsBundle\Form\Type\VtigerTicketcommentsType; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class OpenTicketType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('title') ->add('priority') ->add('solution') ->add('comments', 'collection', array( 'type' => new VtigerTicketcommentsType() )) ; } public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'WbsGo\clientsBundle\Entity\VtigerTroubletickets' )); } public function getName() { return 'ticket'; } } TicketController.php <?php namespace WbsGo\clientsBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use WbsGo\clientsBundle\Entity\VtigerTroubletickets; use WbsGo\clientsBundle\Entity\VtigerTicketcomments; use WbsGo\clientsBundle\Form\OpenTicketType; use Symfony\Component\HttpFoundation\Request; class TicketController extends Controller { public function indexAction() { $em = $this->getDoctrine()->getManager(); $tickets = $em ->getRepository('WbsGoclientsBundle:VtigerTroubletickets') ->findAllOpenByCustomerId($this->getUser()->getId()); $userdata = $this->getDoctrine()->getManager() ->getRepository('WbsGoclientsBundle:VtigerContactdetails') ->findContact($this->getUser()->getId()); return $this ->render('WbsGoclientsBundle:Ticket:index.html.twig', array('tickets' => $tickets, 'userdata' => $userdata)); } public function addAction() { $assets = $this->getDoctrine()->getManager() ->getRepository('WbsGoclientsBundle:VtigerAssets') ->findAssetByAccountId($this->getUser()->getId()); $assetlist = array(); foreach ($assets as $key => $v) { $assetlist[$key] = $key; } $form = $this->createForm(new OpenTicketType(), new VtigerTroubletickets()); return $this ->render('WbsGoclientsBundle:Ticket:add.html.twig', array('form' => $form->createView(), 'assets' => $assets,)); } } This is the error Symfony2 is returning Neither the property "comments" nor one of the methods "getComments()", "isComments()", "hasComments()", "_get()" or "_call()" exist and have public access in class "WbsGo\clientsBundle\Entity\VtigerTroubletickets". EDIT 2 This code is actually rendering my forms, but I need help in order to submit each XXXType form to its corresponding table. public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('descripcion') ->add('prioridad') ->add('solucion') ->add('comment', new VtigerTicketcommentsType() ) ->add('contacto') ->add('suscripcion') ->add('producto', 'entity', array( 'class' => 'WbsGo\clientsBundle\Entity\VtigerAssets', 'property' => 'assetname', 'empty_value' => '--SELECT--', 'query_builder' => function(\WbsGo\clientsBundle\Entity\VtigerAssetsRepository $repository) { //return $repository->findAssetByAccountId($this->customerId); return $repository->createQueryBuilder('a') ->select('a') ->where('a.account = (SELECT cd.accountid FROM WbsGoclientsBundle:VtigerContactdetails cd WHERE cd.contactid = ?1)') ->setParameter(1, $this->customerId); } ) ) ->add('hardware') ->add('backup') ->add('web') ->add('restore') ->add('customerId') ; } I also removed ->add('ticketid') from VtigerTicketcommentsType.php because it has relationship and is not needed. it's auto_incremental and must be generated once everything is submitted.

    Read the article

  • How can I use UML to model a relationship between two classes, where one has functions exposed as friend to the other?

    - by user1796528
    I have a two classes: ------------ --------------- X Y ------------ --------------- relation ------------ ------------------ --------------- A() C() B() D() E() ------------ --------------- I want to inherit just these two functions from X class, where they are defined with the friend access modifier. My class will be: --------------- Y --------------- --------------- C() A() D() --------------- Y class uses some functions of X class namely A and D. How can I model this relationship in a UML class diagram?

    Read the article

  • Oracle Social Relationship Management Implementation Exam is now available in Beta!

    - by Richard Lefebvre
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Get certified in implementing the most complete social relationship management solution on the market. Passing the exam means you will be recognized as an Implementation Specialist for Oracle Social Relationship Management. Schedule your exam as soon as possible to benefit from our exclusive vouchers which can waive the entire exam fee! /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    Read the article

  • Relationship between "Task Parallel Library" and "Task-based Asynchronous Pattern"?

    - by Sid
    In the context of C#, .NET 4/4.5 used for an application running on a web-server, what is the relationship between "Task Parallel Library" and "Task-based Asynchronous Pattern"? I understand one is a library and the other is a pattern. But to dig deeper, is it like "The library is used by the pattern to enforce good practices". I'm also not clear if both are supported in .NET 4.0 (with awake and async keywords) Edit: Seems that awake and async are only in .NET 4.5 ...

    Read the article

  • Entity Framework naming conventions for many-to-many link tables

    - by TimothyP
    Hi, We are designing a SQL Server database with link tables for many-to-many relations. The question is are there any best practices for naming these kinds of tables for use with the entity framework? Let's say there's a table Customer and Address Then there is a link table between them, what do we call it? CustomerAddress ? Or something else? Thnx

    Read the article

  • High-quality ERD generator for PostgresQL under Linux?

    - by Dave Jarvis
    Background MySQL Workbench can produce appealing and high-quality ERDs such as: Research I have not found a tool that even comes close for PostgreSQL. Tools I have found: dbVisualizer - Yellow squares. AquaFold - Yellow squares. SQL Developer - Coloured squares. Dia - Coloured squares. SchemaBank - Can't export to PNG; looks okay, nothing stellar. SchemaSpy - XML export makes it possible to write an XSL skin... Gliffy - Incompatible Flash version. Druid - No. pgAdmin3 - Not applicable? phpPgAdmin - Couldn't login without a 30-minute configuration battle. Requirements Looking for an ERD tool: Visually stunning by default Can reverse-engineer a PostgreSQL (or JDBC-compliant) database Runs on Linux (or under WINE) Export high-resolution PNG (or SVG) FOSS

    Read the article

  • doctrine findby relation

    - by iggnition
    I'm having trouble selecting a subset of data with doctrine. I have 3 tables Location Contact Contact_location The contact and location tables hold a name and an id the other table holds only ID's. For instance: Location loc_id: 1 name: detroit Contact contact_id: 1 name: Mike Contact_location loc_id: 1 contact_id: 1 In doctrine there is a many to many relation between the location and contact tables with contact_location as the ref_class. What i want to do is on my location page i want to find all contacts where for instance the loc_id = 1. I tried: $this->installedbases = Doctrine::getTable('contact')->findByloc_id(1); hoping doctrine would see the relation and get it, but it does not. How can i make doctrine search in relevant related tables? I read it can be done using Findby but i find the documentation unclear.

    Read the article

  • NHibernate Legacy Database Mappings Impossible?

    - by Corey Coogan
    I'm hoping someone can help me with mapping a legacy database. The problem I'm describing here has plagued others, yet I was unable to find a real good solution around the web. DISCLAIMER: this is a legacy DB. I have no control over the composite keys. They suck and can't be changed no matter much you tell me they suck. I have 2 tables, both with composite keys. One of the keys from one table is used as part of the key to get a collection from the other table. In short, the keys don't fully match between the table. ClassB is used everywhere I would like to avoid adding properties for the sake of this mapping if possible. public class ClassA { //[PK] public string SsoUid; //[PK] public string PolicyNumber; public IList<ClassB> Others; //more properties.... } public class ClassB { //[PK] public string PolicyNumber; //[PK] public string PolicyDateTime; //more properties } I want to get an instance of ClassA and get all ClassB rows that match PolicyNumber. I am trying to get something going with a one-to-many, but I realize that this may technically be a many-to-many that I am just treating as one-to-many. I've tried using an association class but didn't get far enough to see if it works. I'm new to these more complex mappings and am looking for advice. I'm open to pretty much any ideas. Thanks, Corey

    Read the article

  • Rails Foreign key setup question.

    - by James P. Wright
    I'm just (re)starting playing around with Rails and I'm making a little card game app. I cannot seem to figure out my Foreign Key setups. Say I have 4 objects: - Game - Player - Hand - Card A Game has many Players, which have many Hands which have many Cards. But the cards are also independent of a Hand, Player and Game. For example, I have 6 Cards in my database (1 to 6). It is possible that Card 3 could be in 2 Players Hands in the same Game. How can I set up my keys for this? Should I just create another object for "CardInHand" to simplify it?

    Read the article

  • Easy way to observe user activity - how improve my database structure.

    - by Thomas
    Welcome, I need some advise to improve perfomence my web application. In the begin I had this structure of database: USER -id (Primary Key) -name -password -email .... PROFILE -user Primary Key, Foreign Key (USER) -birthday -region -photoFile ... PAGES -id (Primary Key) -user Foreign Key(USER) -page -date COMMENTS -id (Primary Key) -user Foreign Key(USER) -page Foreign Key(PAGE) -comment -date FAVOURITES_PAGES -id (Primary Key) -user Foreign Key(USER) -favourite_page Foreign Key(PAGE) -date but now one of the most important page of website is observatory, when everyone can observe activity others users. So I need select all pages, comments and favourites pages some users and display it in one list, sorted by date. For better perfomance (I think) I changed my structure to this: table USER and PROFILE without changes ACTIVITY (additional table- have common fields: user,date) -id (Primary Key) -user Foreign Key(USER) -date -page Foreign Key(PAGE) -comment Foreign Key(COMMENTS) -favourite_page Foreign Key(FAVOURITES_PAGES) PAGES -id (Primary Key) -page COMMENTS -id (Primary Key) -page Foreign Key(PAGE) -comment FAVOURITES_PAGES -id (Primary Key) -favourite_page Foreign Key(PAGE) So now it is very easy get sorted records from all tables. But I have no only foreign key to PAGES, COMMENTS and FAVOURITES_PAGES in ACTIVITY table - there is about ten Foreign Key fields and in one record only one have value, others have None: ACTIVITY id user date page comment ... 1 2 2010-02-23 None 1 2 1 2010-02-21 1 None .... It is corect solution. When I display about 40 records in one page (pagination) I must wait about one secound, but database is almost emty (a few users and about 100 records in others tables). It is depends on amount records per page - I have checked it, but why it takes too long time, becouse of relationships? The website is built in Python/Django. Any advices/opinion?

    Read the article

  • Internal and External Bug-Tracking Setup

    - by devdude
    Most of you certainly use some kind of bugtracker. Maybe internally only, once a customer files a bug via email or phone you add a new ticket by yourself. Sometimes weekly project meetings can be great source of new tickets coming preferably in flavors of excel sheets that the PM on the other side of the table loves to maintain and chase after you. The more advanced (and transparent) version: Allow the customer to file (and see the progress of) his bugs directly into you bugtracker. Systems like JIRA allow you to use profiles to have certain access rights, etc. But now the question: The bug raised by a user not necessary translates into 1 bug in a specific module/method/EJB/class. The version of the (your) web application he uses does not translate into the version of the class that is causing the error. How you maintain the internal part of the ticket with all the nasty techy details and the same time the make-the-user-feel-good ticket (need more info, accepted, in progress,..) ? Creating 2 tickets for internal and external ? Link them ? Any smart recipes to share ?

    Read the article

  • How to do fixed price quote for design sessions?

    - by Shaul
    Normally when I do a system for a customer, I do design sessions on an hourly rate and then come out with a fixed price quotation for the full system development. Now this customer has thrown me a curveball: he doesn't want an hourly rate for design, either - he wants me to quote a fixed price to do all the design, too! Not that he's trying to cheap out, but he doesn't want to be in a situation where the longer design stretches out, the more he has to pay - and I can understand that. For the business layer it was actually not too difficult to work with this, because from his original functional spec I got a good idea of what the core business objects were, and in our design agreement I defined several objects which would be covered by a fixed design price; if any new non-trivial objects were discovered, they would be considered variances, and those would be billed on an hourly rate. So far so good. But when it comes to the UI, things start getting a lot more woolly. How many screens will there be? Don't know yet. What's going to be on each screen? Don't know yet. All we know is that it's a "dashboard" type of system, and there will be a lot of visual reporting involved e.g. gauges, graphs, etc. So maybe make it fixed price per screen design? Not a great definition; he might say that everything is going to be on one screen. Maybe a price per "visual report" design, including ability to slice & dice? Again not so easy - it might be that the entire system is just one report, and all the intelligence is going to go into how to present that segmentation. Anyone have any ideas how to do a fixed price quotation for a UI design like this?

    Read the article

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