FAQ Database Discussion Community


overload resolution failed

vb.net,linq,frameworks,entity
I am trying to use the following LINQ statement to query a database but I keep getting an error saying overload resolution failed because no accessible Where can be called with these argument. Could anyone tell me what I am doing wrong please as I've been pulling my hair out...

Symfony2 Entity with criteria and params

symfony2,entity,criteria
I'm trying to create an entity with a oneToMany relation and criteria like this /** * Get translatedData * * @return translatedData collection */ public function getTranslatedData($language) { $criteria = Criteria::create()->where(Criteria::expr()->eq("language", $language)); $result = $this->getAllTranslatedData()->matching($criteria)[0]; if (count($result) == 0){ $criteria = Criteria::create()->where(Criteria::expr()->eq("language", 'en')); $result = $this->getAllTranslatedData()->matching($criteria)[0]; } return...

Doctrine persist entity with inverse relation not work

symfony2,doctrine2,entity
I'm trying to save two entities linked. Product entity may have any or many entities ProviderRate. When I try to save the product entity, it tells me that ProviderRate related entity has not assigned one of their required fields. I need to save a product with no need to assign...

Why JPA entities are treated like this outside a session?

jpa,entity
Hy, I am having a "Solve failed to lazily initialize a collection of role.... exception" in jpa. I understand that outside a session, when you want to retrieve a lazy collection if there is not session bound you will get this error, fine. But what I dont understand is if...

How would I add properties to an entity using a method instead of hard coding it (using Entity Framework)?

c#,asp.net-mvc,database,entity-framework,entity
I am using Entity Framework to help store some entities I have coded in C# to create a simple web application. I want to know how to add a property (field) to an entity without coding it into the entity class. Take my employee entity, for example: public class Employee...

How large of a String should generally be stored in one core data entity attribute?

ios,core-data,attributes,entity
How large of a String should generally be stored in one core data entity attribute? At what point should the String be broken into multiple attributes or even multiple entities with relationships? I don't know how space-dense Strings are. Imagine wanting to save text from 100 pages into 1 attribute:...

In Entity Framework, how do I add a generic entity to its corresponding DbSet without a switch statement that enumerates all the possible DbSets?

c#,database,entity-framework,entity
I have two types of entities: an employee entity and an office entity, with a one to many relationship between the two such that there are many employees for one office. For EF, a DbSet is created in the context file for each entity: public DbSet<Office> Offices { get; set;...

swift: core data with slideout navigation for a blog + multiple entities

ios,json,swift,core-data,entity
I am making a blog reader app in which the categories of the blog are listed in the slide out navigation and each category fetches unique JSON Results and displays in the CenterViewController Now, the CenterViewConroller saves the data into CoreData before displaying it in the UITableView with this code:...

Doctrine2 entity creation error : “Could not find driver”

php,symfony2,doctrine2,entity
I'm learning how to use Doctrine in Symfony. I'm using Ubuntu 14.04. My parameters.yml is configured with pdo_pgsql. My issue is when i give a shortcut name to my entity, 3 errors "could not find driver" appear. Here are two pictures of my terminal with the errors. http://hpics.li/d6824c3 http://hpics.li/3ddd6c7 I...

Two records in database on 1 form

php,symfony2,doctrine2,entity,locale
I have an entity Page with fields: pageID (PK) and tag. I have an entity PageLocale with fields: pagelocaleid (PK), description, content, locale, translated and pageID (FK). My Database Structure: My entity PageLocale: <?php namespace DX\MyBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\UploadedFile; /** * Pagelocale * * @ORM\Table(name="pageLocale", indexes={@ORM\Index(name="fk_pageLocale_page1_idx", columns={"pageID"})})...

What exactly returns EntityUtils.toString(response)?

android,apache,rest,entity
I'm doing my API REST and I saw that in a lot of examples people use EntityUtils.toString(response) to get their response into a String from their GET, POST, PUT and DELETE methods. Similar to this: HttpGet method = new HttpGet(url); method.setHeader("content-type", "application/json"); HttpResponse response = httpClient.execute(method); String responseString = EntityUtils.toString(response.getEntity());...

Manipulate form data before persisting entity - Symfony 2.6

php,forms,symfony2,entity,symfony2-forms
I have an entity which has a field called end_date which is datetime. In my symfony form I have a unbinded field which you can select an amount of days e.g 3 days, 5days, 7 days. What i need to do is manipulate the amount of days provided by the...

Symfony2 form type entity add extra option

php,forms,symfony2,entity
I have the following Symfony form field, it's a drop down that loads from an entity: ->add('measureunit', 'entity', array('label' => 'Measure Unit', 'class' => 'TeamERPBaseBundle:MeasureUnit', 'expanded' => false, 'empty_value' => '', 'multiple' => false, 'property' => 'abreviation' )) As you can see I have added 'empty_value' => '' and everything...

Object persistence doesn't work

java,glassfish,entity,persistence
I'm trying to implement a little chat with JPA. Everythings work except one thing. I want, when my user open the connection with the endPoint, save his room number, his nickname and the timstamp. My table has been well created, columns too but i cant persist my Connexion Object in...

Symfony2 - Entity Collection Choice Restriction

php,symfony2,doctrine,entity,twig
I have the following setup: Entity: Customer Entity: Account Entity: Message Now imagine the following problem: The account 'Mark' is in charge of two customers, 'Ben' and 'Lili'. The account 'Tim' is in charge of two other customers, 'Tom' and 'Ronny'. The account 'Ben' now wants to send a message...

Symfony2 insert multiple entities

symfony2,entity,entitymanager,persist
I have a question about inserting multiple entities. What happens to the entities if i persist every entity in a loop and then i flush ? I mean what happens if one of this entities is duplicated and can't be inserted ? Are all entities removed or only the one...

How to use Linq to join entity tables with a cross-reference table

.net,linq,entity-framework,entity,entity-framework-6
Let me preface this by saying I'm relatively new to Linq, but I seem to have grasped most of it pretty quickly. But this problem has me stumped. I've searched and searched to no avail. I am using code-first and have created have 2 models, "Items" and "Keywords". They have...

Symfony 2 - Class “Mingle\StandardBundle\Entity\Product” is not a valid entity or mapped superclass

php,symfony2,doctrine,entity,bundle
I created a Product.php file in my bundle Mingle\StandardBundle\Entity like this: <?php namespace Mingle\StandardBundle\Entity; use Doctrine\ORM\Mapping as ORM; /* * @ORM\Entity * @ORM\Table(name="product") */ class Product { /* * @ORM\Column(type="integer") * @ORM\ID * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /* * @ORM\Column(type="string",length=100) */ protected $name; /* * @ORM\Column(type="decimal",scale=2) */ protected $price; /*...

Is it good practice to have a getter for every property in a class representing a row, or should I investigate another approach?

php,oop,entity,data-entry
I have a NoteEntity class that is meant to represent a row in my notes table. An "(data)entity" in my framework strictly means a stored/storable data entry - a database row, if you will. Creating such an object is as straightforward as initializing it with an array returned by mysqli_fetch_array(),...

What does an entity's constructor look like for DDD in php?

php,constructor,entity,domain-driven-design,ddd-repositories
I'm confused on what a constructor looks like in PHP using a DDD aproach. This is what I have so far: Entity class People { // Fields private $id; private $first_name; // required private $middle_name; private $last_name; // required private $phone; // required (or mobile_phone required) private $mobile_phone; private $email;...

Converting JPA Entities to a Map

java,mysql,jpa,entity
I'm pretty new to JPA and databases in general, and I'm trying to teach myself some of this. I want to know if it's at all possible to turn a List you retrieve of a particular entity into a map. Ultimately I want to get a List of Maps of...

Symfony2 - Best Practices to trigger 404 exception

php,symfony2,exception,model-view-controller,entity
what is a best practice to throw Exceptions in Symfony? There is a good example in documentation http://symfony.com/doc/current/book/controller.html#managing-errors-and-404-pages to throw exception in Controller. Second way is throw Exception in Model, for example I have Entity Product with this method: class ProductRepository extends EntityRepository { public function getProductBySlug($slug) { $product =...

Using Entity Framework, how do I access the number of employees (one entity) corresponding to each office (another entity)?

c#,asp.net-mvc,linq,entity-framework,entity
I have two entities: an employee entity and an office entity. There is a one-many relationship between these two entities -- that is, one office may have many employees but each employee only has one office. I am using Entity Framework 6 to work on a project. I am currently...

org.hibernate.MappingException: Unknown entity: from xxx

hibernate,mapping,entity
I was trying to resolve issue which I posted here But, now I'm getting another issue. :( org.hibernate.MappingException: Unknown entity: from EmpTest at org.hibernate.internal.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:1095) at org.hibernate.internal.SessionImpl.getOuterJoinLoadable(SessionImpl.java:1754) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1659) at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:380) at com.model.EmpModelImp.getAll(EmpModelImp.java:84) at...

Multiple behaviours for single entity

testing,process,entity,vhdl
I wrote a VHDL Testbench which contains the following : Lots of signal declarations UUT instantiations / port maps A huge amount of one-line concurrent assignments Various small processes One main (big) process which actually stimulates the UUT. Everything is fine except the fact that I want to have two...

Hibernate's Criteria With Example And Query Return different results

java,spring,hibernate,entity
I am using hibernate for entity persistence in application however when i use HQL to fetch entities it works fine and returns the exact number of entities that is there in a table however when i use the hibernate's criteria with Example it return first entity twice and thus results...

A reference to the object element Symfony2

symfony2,doctrine,entity
I try to get to "content" from message entity. This is my dump($messages): http://s13.postimg.org/96ytd93vb/message.png and my code in controller: $em = $this->getDoctrine()->getEntityManager(); $messages = $em->getRepository('DashboardMainBundle:Message')->findBy( array( 'receiver'=> $UserId, 'id' => $Id ), array('createdAt' => 'ASC') ); How can I take "content" from this array in controller? It looks simple but...

Create A View, Select a Column As Primary Key

sql,entity,primary-key,sql-view
I have a long code line to create a view. For Entity framework to work with this view I need a primary key. How can I select the column as a primary key? I've tried this; dstchannel,billsec,disposition,accountcode, uniqueid as PRIMARY KEY,cnam, callRateImport.Description, callRateImport.Code, callRateImport.Day FROM callLogImport LEFT JOIN callRateImport ON...

Symfony entity field : manyToMany with multiple = false - field not populated correctly

php,forms,symfony2,doctrine2,entity
I am using symfony2 with doctrine 2. I have a many to many relationship between two entities : /** * @ORM\ManyToMany(targetEntity="\AppBundle\Entity\Social\PostCategory", inversedBy="posts") * @ORM\JoinTable( * name="post_postcategory", * joinColumns={@ORM\JoinColumn(name="postId", referencedColumnName="id", onDelete="CASCADE")}, * inverseJoinColumns={@ORM\JoinColumn(name="postCategoryId", referencedColumnName="id", onDelete="CASCADE")} * ) */ private $postCategories; Now I want to let the user only select one category....

Upload file function not hit symfony2

php,symfony2,entity
I'm facing a weird issue : when I want to change the profil's picture of an user (using Symfony2), the function to upload the file is not call and so, my picture is not changed... But, when I create the user (the first time), the function is called and the...

Missing something in this method to get the Entity property

c#,asp.net-mvc,reflection,entity
private String[] GetProperties(EContent_EcontentFields eContentField) { List<String> list = new List<String>(); Type fieldType = eContentField.GetType(); var properties = fieldType.GetProperties(); foreach (var prop in properties) { if (prop.MemberType == MemberTypes.Property) { if (prop.PropertyType.IsGenericType) { dynamic items = prop.GetValue(eContentField, null); foreach (var item in items) { Type typeItem = item.GetType(); list.Add(item); } }...

Symfony2 : Add method to an Entity

php,symfony2,entity,add
I would like to add a method to an Entity. This method returns X characters from the Entity's title, and i would like to print this title in my twig file. Is it possible ? twig : <ul class="nav nav-pills nav-stacked"> {% for blog in listBlogs %} <li> <a href="{{...

Doctrine OneByOne's and Date

php,symfony2,doctrine2,entity
I am using Symfony 2.7.1 and I seem to have a problem while using my News Entity. I am trying to use the published_at in my twig template. I tried using {{ news_item.published_at|date("m/d/Y") }} but that seems to follow up by a fatal error: Method "published_at" for object "AppBundle\Entity\News" does...

What is the cause of this EF6 behaviour Find() does not return a proxy but Single() does return a proxy

c#,entity-framework,entity,poco,proxy-classes
I have a POCO class BankAccount which is public and all of the members are public properties and navigation properties are set to virtual. Entity Framework 6.1.2 correctly loads it from the database as a POCO using the Find() method. However, as far as I am aware it should be...

Calling an entity method from controller

angularjs,symfony2,controller,entity
I'm having an issue with the following... My HTML Angular section <button ng-click="setFollowed(store)" class="btn btn-default">Follow</button> My app.js ..... $scope.setFollowed = function(aStore){ $http.put('/set-followed-store/aStore', { params: { aStore: aStore } }).success(function(data){ alert(aStore.nombre); }). error(function(data, status, headers, config) { alert(data); }); } This works fine. The problem appears when I invoke the method...

How to save data from Mapper to Entity using Left Joined data in PHP

php,mysql,entity,datamapper
I have simple custom made Entity and Mapper class. Mapper is used to get data from Database, and Entity is a collection object with variables, getter/setter methods and relationships between Entities. Model\Entity\Category class Category extends Entity { private $id, $name, $link; // belongs to private $category; // has many private...

Stop prePersist LifeCycleEvent being recursive in Doctrine2 Entiy

php,symfony2,recursion,doctrine2,entity
I am using a the prePersist LifeCycleEvent to update an Entity, updating this Entity creates a loop as the object is re-saved over and over again to the database. public function doSomething(LifecycleEventArgs $event) { // Stuff here $em = $event->getEntityManager(); $em->persist($entity); $em->flush(); } How can I have the Entity update...

Can I set a field value in an Entity by providing the field name?

symfony2,reflection,entity
I am writing a bundle that is supposed to be used with different user-defined entities. I would like this bundle to be able to access a user-provided field in that entity. Is there a method that looks like $entity->set('field', 'value')? Do I have to do it from scratch using reflection?...

JPA, Hibernate can I do composite primary key which one element is foreign kay @OneToMany?

hibernate,jpa,foreign-keys,entity,composite-primary-key
I would like to have in my entity composite primary key consisting of 2 columns (attributes), and have one of them to be foreign key simultaneously. I write something like this, but don't know whether it works cause foreign key is marked as generated value in IntelliJ data source @Entity...

Update a row(entity) in a table only if a change detected(automatically)

sql-update,entity,detect,cakephp-3.0,changes
Sorry for my bad english :( I'm using the CAKEPHP 3 framework and i want to update a row(entity) in a table only if a change detected(automatically). Eg.: $id = 1; // debug($this->request->data) $this->request->data = ['id' => 1, 'name' => "My Name", 'content' => "My Content"]; // Inside the ArticlesController...

breeze.js not honoring the “noTracking” option when end point returns multiple result sets

api,entity,breeze
Consider this breze query: return EntityQuery.from('myAPI') .noTracking(true) .using(manager).execute() .then(querySucceeded) .fail(queryFailed); My API is defined like this: [HttpGet] public object myAPI() { // var userId = get the users id from auth ticket var userPref = _contextProvider.Context.UserPreferences.Where(u => u.userId == userId); var userOptions = _contextProvider.Context.UserOptions.Where(u => u.userId == userId); return new...

Symfony comparing two entities and getting names of different fields

symfony2,entity
Is there an easy way of comparing two entities and getting the names of the fields which do not match without using an if statement for each of the them?

Fill my form with the data that I pick up from a table - Symfony2

forms,symfony2,entity,dql
My problem is this : I have an entity that contains user data , such as: age name surname address phone ... My goal is to make a form where using a query can bring all this data and fill my form with the data , so that the user...

Can not define operator on list

c#,list,entity,operator-keyword
I have an error in this section : i need + operator for sum two List... public partial class Question { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public Question() { this.Answers = new HashSet<Answer>(); } public long Question_Code { get; set; } public Nullable<byte> Question_ExamCode { get; set; } public Nullable<byte> Question_LessonCode { get;...

EasyCriteria: We could not find the parameter: creationDate in the given class Assignment

jpa,inheritance,entity,criteria
So, I'm making a EasyCriteria-query. I have a mapped superclass: @MappedSuperclass public abstract class CreatedEntity extends IdEntity implements Creatable { private static final long serialVersionUID = 1L; @ManyToOne @JoinColumn(name="fk_creation_userid") protected UserId creationUserId; @Temporal(TemporalType.TIMESTAMP) @Column(name="creation_date") protected Date creationDate; Then I have a subclass that makes an EasyCriteria query: @Entity @Table(name =...

Entities passed to the choice field must be managed. Maybe persist them in the entity manager?

php,forms,symfony2,doctrine2,entity
I am new to Symfony2, and I am not getting any answer for this error message Entities passed to the choice field must be managed. Maybe persist them in the entity manager? My version of Symfony is 2.3 I go such code in my Controller addAction() $em = $this->getDoctrine()->getManager(); $user...

Flattening nested entities with ids in Clojure

dictionary,clojure,functional-programming,entity,flatten
Lets say I define an entity (with nested entity) in the form: {:id 1 :a 7 :b "Bob" :c {:id 2 :d 9} } I would like to convert this to a vector of vectors of the form [[id key value]] e.g. [ [1 :a 7] [1 :b "Bob"] [2...

How @BatchSize works in Hibernate deep explanation?

java,hibernate,jpa,entity
I read related topics about BatchSize from the Net and from the forum but I still do not understand some parts. So lets describe what I understand and what do not understand. Batch fetching: an optimization strategy for select fetching. Hibernate retrieves a batch of entity instances or collections in...

How to get Container object from LifecycleEventArgs of postLoad in Entity?

php,symfony2,entity,containers,symfony-2.6
I'm trying to inject the Container object (which is available in controllers) into an Entity using postLoad lifecycleCallbacks. The argument to the postLoad method is LifecycleEventArgs. I could see the container property (which I want to retrieve) in EventManager of LifecycleEventArgs according to the dump output, but it seems to...

Count of childrens 1-* children *-* Linq Entity Framework

c#,linq,entity-framework,linq-to-entities,entity
I am a bit new to LINQ and EF and was trying to get the total count of students in each class taught be each teacher in the below database. I want to output the teacher name followed by the class name and then the count of students in that...

There is no ViewData item of type 'IEnumerable' that has the key 'GradingId'

c#,asp.net,asp.net-mvc,linq,entity
Im trying to get a drop-down list to work for users who are being graded. Each user can have multiple gradings. So when i create a new grade i want a drop-down to specify which use who will be receiving the grade. I keep getting: There is no ViewData item...

VB.NET Entity Framework Does context load all records when it's created?

c#,.net,vb.net,entity-framework,entity
I'm an absolute beginner with entity framework. I recently found ef and I think it will do a fine job with my project. I have played with it and I am a little confused with how it actually works. Here's the situation. Contact table has id, fname, lname, phone columns....

Aggregate for one entity

entity,domain-driven-design,aggregate,ddd-repositories,aggregateroot
In Domain-driven design if I want to use a repository I need to have an aggregate for it - as I understand. So I have a User, that has id, login, email, and password. A user is a domain Entity with unique Id. When i want to add a User...

Symfony2 - Nested form with nested objects

php,forms,symfony2,object,entity
I'm quite new to Symfony and I'm trying to make a nested form with entities to reduce code duplication, it's easiest to explain with code. I followed the example on the doc (How to Reduce Code Duplication with inherit_data), so I created two entities: class Company { private $name; private...

VHDL: Convert String to Std_Logic_Vector

string,entity,vhdl,sha
I'm writing a sha-256 hash function in VHDL and it takes in a String. I need to convert this string to a std_logic_vector of bits. So, I must somehow extract the bits from the characters of the String, but I'm not sure of the best way. As far as I...

how can i get repository of many entities in one getRepository

symfony2,repository,entity
I have tried this but it wont work it just execute the first entity $resultat = $con->getRepository("PFESiivtBundle:Categorie","PFESiivtBundle:Evenement", "PFESiivtBundle:Projet")->findBy(array('idPublication' =>$respub),array('id'=>'DESC') ); ...

Symfony2 Catchable Fatal Error: Argument 1 passed to entity Catchable Fatal Error: Argument 1 passed to entity

php,forms,symfony2,entity,symfony-2.6
I got this error and I'm stuck since many hours Catchable Fatal Error: Argument 1 passed to Thinking\ThinkBundle\Entity\InYourMind::setThinkFriend() must be an instance of Thinking\ThinkBundle\Entity\InYourMindFriend, array given, called in /var/www/html/thinkroulette/vars/vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/PropertyAccessor.php on line 410 and defined I searched for this issue and lots of results came up but I wasn't capable to...

AppBundle's Best Practice and how-to go further

php,symfony2,doctrine2,entity
According to this page on the documentation website of symfony they explain how to address your application logic and the best practices. The one thing I am missing in this documentation is the way to store and use your entities. There is a small section that covers the usage of...

Entity Framework Search Function ASP.NET Webforms

asp.net,search,frameworks,entity,repeater
I have an SQL2014 database that contains clothing products. The database is integrated in an ASP.NET webforms website using gridviews, formviews, repeaters and now the entity framework. I wish to have a simple search function on the website where users can search for the partial name of a product and...

Convert lambda expression to Json

asp.net-mvc,linq,lambda,kendo-ui,entity
First of all please be sure that none of the solution on stackoverflow has not solved my problem (maybe it is caused from Entity Framework 6). I have 3 entities: Student, City and Region as below: Entities: public class Student { public int ID { get; set; } public string...

DDD: Can an entity have attributes of primitive data types?

object,attributes,entity,domain-driven-design,value
The domain driven design differentiates two model types: entities and value objects. In the most examples the attributes of an entity are value objects or other entities, while the attributes of a value object are mostly simple strings, integers etc. (i. e. primitive data types). That leads me to the...

'System.Collections.Generic.List.Contains(int)' has some invalid arguments

linq,entity-framework,entity
A Enity framework query shows error don't know why. If i am trying to get list of primary Id's. int PlantDemandId = 1; var result = (from c in context.tbl_PlantSupply where c.DemandId == PlantDemandId select c.Id).ToList(); c.Id is a primary key when i am using c.DemandId it is working fine....

Symfony entity field type with custom unselectable separators

forms,symfony2,select,entity
Lets say I have an entity City which has cityName also has priority 1, 2 or 3. I need to create a select box with the cities ordered by priority (ascending) and also add a separator before priority changes. the list should look something like that: ---Big cities: bigCity1 bigCity2...

Generate metadata from interface breeze+Typescript

typescript,entity,breeze
I have some models, and i want to use them in typescript, so that breeze can consume those models and build metadataStore, but don't know what to do, there is some methods to add properties by hand, but i want to build metadataStore from existing model This is my typescript...

How to convert html entities into hex entities in php?

php,html,hex,entity
I have a file which has many html entities. I need to convert html entities to hex entities. Example: &amp; to &#x00026; Is there any function for the conversion of html to hex entities? If no, which way would be the effective and fastest way to achieve this? ...

Designing JPA Entity for Database Table

mysql,database,hibernate,jpa,entity
I am designing a voting application and designed a database with 2 tables - State and District. The two tables are - State details table State_ID NUMBER(3) State_name VARCHAR2(30) PRIMARY KEY(State_ID) District details table District_ID NUMBER(3) State_ID NUMBER(3) District_name VARCHAR2(30) PIN_Code NUMBER(6) PRIMARY KEY(District_ID) UNIQUE(State_ID, District_name) FOREIGN KEY(State_ID) As two...

AngularJS & Entity Framework - Creating association without duplicating entity

angularjs,entity-framework,asp.net-web-api,entity
I am using Angular and EF, and I am trying to create an association on the client side, send this to the server, and have the database updated. I have 2 entities, EQUIPMENT and INCIDENT. EQUIPMENT has an association with INCIDENT. Here is some code: //Returns an INCIDENT EF entity...

How to do to have a generic Entity for SQL audit tables with JPA or Hibernate?

generics,jpa,entity,reverse-engineering,generic-programming
I want to show all datas of my audit tables in a jsf page from SQL server. I dont khnow how to do for this ? I have to khnow the fieled of every audit table in the database to create a Entity class , or there a generic Entity...

Symfony2 entity foreign keys

symfony2,doctrine2,foreign-keys,entity
I can't figure it out.. Why I haven't access to Country table? countryName should show Great Britain but it doesn't. This is my dump($User): My my piece of code of User entity: /** * * @ORM\ManyToOne(targetEntity="Dashboard\MainBundle\Entity\Country", cascade={"persist"}) * @ORM\JoinColumn(name="country_id", referencedColumnName="id", nullable=true) * */ private $countryId; And my piece of code...

Multiple entity in one form Symfony

php,symfony2,entity,twig
I have an entity "ticket" and I would like to create a form with many of this entity. So I created a FormType like this : class TicketType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('quantity'); } public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => null, )); } public...

JPA/Hibernate Query Slow with too many queries

hibernate,java-ee,jpa,entity
I have two entities Employee and Department The Employee entity is a read-only dataset for my application (I don't own this table) The table data backing the Department Entity I do own. If I query my Employee entity without annotating a Department to Employee entity relationship, the query is superfast...

How do I properly initialize / define an object of the Text Class in Google App Engine?

java,google-app-engine,constructor,entity
I am working with Google App engine for a project. One of the classes it uses is called the "Text" class. (Link for documentation is here: https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Text) I am having trouble figuring out how to initialize the variable properly as one of the parameters I am using requires I pass...

Symfony 2.6 : How to get the current provider used to log in?

php,symfony2,entity,provider
I' am facing an issue in my SF2.6 project. I have two sort of user(Client, Employee) so I'am using multiple entity provider providers: chain_provider: chain: providers: [employee, client] employee: entity: { class: SpeedDev\MyprojectsBundle\Entity\Employee, property: emailEmp } client: entity: { class: SpeedDev\MyprojectsBundle\Entity\Client, property: contactemailClient } that work I can log into...

JPA/Hibernate @IdClass Produces 'Identifier of an Instance was Altered'

java,hibernate,jpa,orm,entity
For a JPA entity model using a case-insensitive database schema, when I use a @IdClass annotation I consistently get 'identifier of an instance was altered' exception. For an object with a 'string' primary key, the error occurs when an string of one case exists in the database and a query...