Search Results

Search found 2536 results on 102 pages for 'entities'.

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

  • Enumerable.Range in and Expression and Entity Framework

    - by eka808
    I'm currently developping an expression method (used in linq to entity queries) who has to give me a daycount for a given period (start date and end date) decrementing this daycount if specials days are in the period. My idea was the following : Generate an enumerable with all the dates (and with Enumerable.Range) Make a .Where on this enumerable to remove the specials dates Like a MyEnumerable.Where(a = a != "20120101") After that, return a MyEnumerable.Count() I come with this code : return (p) => Enumerable .Range(1, 4) .Where(a => a != 20120101) .AsQueryable() .Count() I tried to cast as a list, as a queryable, both (like the example) and no way ! it doesn't work ! I always get this error : LINQ to Entities does not recognize the method 'System.Collections.Generic.IEnumerable`1[System.Int32] Range(Int32, Int32)' method, and this method cannot be translated into a store expression. Have you got an idea about that ? Using an enumerable is of course not mandatory, any working solutions is good ^^ Thank's by advance !

    Read the article

  • How are managed the sequences by JPA and Hibernate?

    - by romaintaz
    Hi all, I am using Hibernate in my project, and many of my entities use a sequence for their technical keys. For example: @Entity @Table(name = "T_MYENTITY") @SequenceGenerator(name = "S_MYENTITY", sequenceName = "S_MYENTITY") public class MyEntity { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "S_MYENTITY") @Column(name = "MY_ENTITY_ID") private Long entityId; ... } I have two questions about the ID generated by Hibernate when a new object of this class is persisted: Why SequenceGenerator (from javax.persistence) has a default value of allocationSize set to 50 instead of 1? What are the interests of that? What is the default algorithm used by Hibernate to calculate the generated ID? It seems that Hibernate uses the value returned by the sequence hosted by my Oracle database, but then modify it before assigning it to my entity...

    Read the article

  • Select from parent table return ID = 0 column values for child objects

    - by SaD
    Entities: public class Person { public Person(){} public virtual long ID { get; set; } } public class Employee : Person { public Employee(){} public virtual long ID { get; set; } public virtual string Appointment { get; set; } } Mappings: public class PersonMap : ClassMap<Person> { public PersonMap() { Id(x => x.ID) .GeneratedBy.Identity(); } } public class EmployeeMap : SubclassMap<Employee> { public EmployeeMap() { KeyColumn("ID"); Map(x => x.Appointment) .Not.Nullable() .Length(50); } } 2 items in Person table 1 item in Employee table (1 in base class, 1 in child class) Query:var list = Session.CreateQuery("from Person").List<Person>(); Return: 0 | ID = 1 1 | ID = 0, Appointment = "SomeAppointment"

    Read the article

  • EntityFramework: using association or add property manualy

    - by dritterweg
    I'm starting to use Entity Framework. Let's say I have to Entity from my tables in DB. Here is the table schema Profiles ProfileId FirstName LastName Hobbies Id HobbyName OwnerId So one profile can have many hobbies. My Entity Framework: ProfileEntity ProfileId FirstName LastName Hobbies (collection of HobbyEntity) note: this created by the Association tool HobbyEntity Id HobbyName Owner (type of ProfileEntity) note: this created by the Association tool, for me this property is not important my question: should I use the "Association" tool to make the relationship between the two entities, which in result create a property of each entity (in ProfileEntity will create a HobbyEntity and vica versa) or should I not use the association and only add a scalar property manually such as List<HobbyEntity> in my ProfileEntity and OwnerId in HobbyEntity.

    Read the article

  • Where does the data model go in a Prism app?

    - by HawkeyeJoeS
    I'm having trouble where to put our data model in our Prism app. Most, if not all or our data will be coming from web services and the web services are unique for each module. Unfortunately, there will be objects that need to be shared (such as a person/user object). I'm really torn about whether to add these services directly to the module, so that each is truly independent, or create a separate project to house the web service proxies and business entities. The modules are being built by different teams, but will all live in the same solution (and source control, of course).

    Read the article

  • Entity Framework 5 upgrade from 4

    - by user1714591
    I'm having an issue with the Where clause in a search, in my original version EF4 I could add a Where clause with 2 parameters, the where clause (string predicate) and a ObjectParameter list such as var query = context.entities.Where(WhereClause.ToString(), Params.ToArray()); since my upgrade to EF5 I don't seem to have that option am I missing something? This was originally used to build dynamic where clause such as "it.entity_id = @entity_id" then holding the variable value in the ObjectParameter. I'm hoping I don't have to rewrite all the searches that have been built out this way, so any assistance would be greatly appreciated. Cheers

    Read the article

  • SSAS OLAP MDX and relationships

    - by Sonic Soul
    I new to OLAP, and still not sure how to create a relationship between 2 or more entities. I am basing my cube on views. For simplicity sake let's call them like this: viewParent (ParentID PK) viewChild (ChildID PK, ParentID FK) these views have more fields, but they're not important for this question. in my data source, i defined a relationship between viewParent and viewChild using ParentID for the link. As for measures, i was forced to create separate measures for Parent and Child. in my MDX query however, the relationship does not seem to be enforced. If i select record count for parent, child, and add some filters for the parent, the child count is not reflecting it.. SELECT { [Measures].[ParentCount],[Measures].[ChildCount] } ON COLUMNS FROM [Cube] WHERE { ( {[Time].[Month].&[2011-06-01T00:00:00]} ,{[SomeDimension].&[Foo]} ) } the selected ParentCount is correct, but ChildCount is not affected by any of the filters (because they are parent filters). However, since i defined a relationship, how can i take advantage of that to filter children by parent filter?

    Read the article

  • Cakephp: Designpattern for creation of models in hasMany relationship

    - by Chris
    I have two Models: Car and Passenger. Car hasMany Passenger Passenger belongsTo Car I managed to create add functionailty for each model and managed to resolve the hasMany relationship between them. Now I'm trying to create a addCar function and view that allows the user to create a new car and automatically generate Passengers. I thought of something like this The view asks the user enter the car information The view has some field that allows to temporarly add new passengers and remove remove them When the user saves the new car, the entities for the passengers are created, the entity for the car is created and the passengers are linked to the car. If the user decides to cacnel everything, the DB remains unchanged. Now my question is: What is the best way to do this? Is there a pattern / tutorial to follow for such a entity and associated subentity creation? To clarify: The passengers associated with each car do not exist prior to the existence of the car.

    Read the article

  • Disable Foreign Key Exposure in Entity Framework?

    - by davemackey
    When I originally created a Dynamic Data project I told it to expose the foreign keys, but now I can't make mappings between two entities b/c of the foreign keys. When I click on mapping details while focused on my association I receive the message: Mappings are not allow for an association over exposed foreign keys. So I'd like to disable the exposure of the foreign keys but am unsure how to do this without creating a new Entity Model from scratch. I'm not far along - so that wouldn't be hard, but I imagine there must be a programmatic switch for this?

    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

  • Is JPA + EJB to much slow (or heavy) for over Internet transactions?

    - by Xavier Callejas
    Hi, I am developing a stand-alone java client application that connects to a Glassfish v3 application for JPA/EJB facade style transactions. In other words, my client application do not connect directly to the database to CRUD, but it transfers JPA objets using EJB stateless sessions. I have scenarios where this client application will be used in an external network connected with a VPN over Internet with a client connection of 512kbp/DSL, and a simple query takes so much time, I'm seeing the traffic graph and when I merge a entity in the client application I see megabytes of traffic (I couldn't believe how a purchase order entity could weight more than 1 mb). I have LAZY fetch in almost every many-to-many relationship, but I have a lot of many-to-one relationships between entities (but this is the great advantage of JPA!). Could I do something to accelerate the the speed of transactions between JPA/EJB server and the remote java client? Thank you in advance.

    Read the article

  • getjson alternative method for variable

    - by Florian Stanek
    I made a script which gets the data from a json file and parse it. It worked on a webserver. But now I have to find a solution to get it work on a local file (file:///C:/xampp/htdocs/script/index.html) instead on a server. It only works in FF: $.getJSON('data2.json', function(data) { $.each(data.selection_form.entities, function(i,name){ ...do something }); }); Any ideas? A local webserver is not a solution.

    Read the article

  • Why Hibernates ignores the name attribute of the @Column annotation?

    - by svachon
    Using Hibernate 3.3.1 and Hibernate Annotations 3.4, the database is DB2/400 V6R1, running that on WebSphere 7.0.0.9 I have the following class @Entity public class Ciinvhd implements Serializable { @Id private String ihinse; @Id @Column(name="IHINV#") private BigDecimal ihinv; .... } For reasons I can't figure, Hibernate ignores the specified column name and uses 'ihinv' to generate the SQL: select ciinvhd0_.ihinse as ihinse13_, ciinvhd0_.ihinv as ihinv13_, ... Which of course gives me the following error: Column IHINV not in table CIINVHD Did anyone had this problem before? I have other entities that are very alike in the way that they are using # in their database field names and that are part of the PK and I don't have this problem with them.

    Read the article

  • Options for storing large text blobs in/with an SQL database?

    - by kdt
    Hi, I have some large volumes of text (log files) which may be very large (up to gigabytes). They are associated with entities which I'm storing in a database, and I'm trying to figure out whether I should store them within the SQL database, or in external files. It seems like in-database storage may be limited to 4GB for LONGTEXT fields in MySQL, and presumably other DBs have similar limits. Also, storing in the database presumably precludes any kind of seeking when viewing this data -- I'd have to load the full length of the data to render any part of it, right? So it seems like I'm leaning towards storing this data out-of-DB: are my misgivings about storing large blobs in the database valid, and if I'm going to store them out of the database then are there any frameworks/libraries to help with that? (I'm working in python but am interested in technologies in other languages too)

    Read the article

  • How to dynamically order many-to-many relationship with JPA or HQl?

    - by Indrek
    I have a mapping like this: @ManyToMany(cascade = CascadeType.PERSIST) @JoinTable( name="product_product_catalog", joinColumns={@JoinColumn(name="product_catalog", referencedColumnName="product_catalog")}, inverseJoinColumns={@JoinColumn(name="product", referencedColumnName="product")}) public List<Product> products = new ArrayList<Product>(); I can fetch the products for the catalog nicely, but I can't (dynamically) order the products. How could I order them? I probably have to write a many-to-many HQL query with the order-by clause? I though of passing the orderBy field name string to the query, or is there a better solution? Tables are: products, product_catalog, product_product_catalog (associative table) P.S. Using Play! Framework JPASupport for my entities.

    Read the article

  • ORM Against a Service-Wrapped Data Source

    - by blaster
    We are tasked with migrating an existing set of entities (currently POCOs persisted with NHibernate against an MSSQL database) to now persist to some kind of web service (yet to be built, either RESTful or SOAP-based, and that we control). I like how NHibernate encapsulates the persistence concerns and lets us maintain a logic-rich, persistence-agnostic domain model. Is there any way to make NHibernate talk to a web service at the back end instead of a SQL database directly? In other words, can "service instead of SQL database" be treated as a persistence implementation detail and allow us to continue to use NHibernate? Am I asking the right question? :)

    Read the article

  • Alt attribute encoding with JavaScript

    - by MainMa
    Hi, Html entities must be encoded in alt attribute of an image in HTML page. So <img id="formula" alt="A &rarr; B" src="formula.png" /> will work well. On the other hand, the same JavaScript code will not work document.getElementById('formula').alt = 'A &rarr; B'; and will produce A &rarr; B instead of A → B. How to do it through JavaScript, when it is not possible to put the special (unencoded) characters in the source code?

    Read the article

  • ASP.Net layered communication

    - by Chris Klepeis
    Hi, We're developing a layered web application. The specs: 3 layers, data layer, business layer, ui layer. Programmed in C# Data Layer uses the entity framework Currently we plan on having the data layer return IEnumerable<T> to the business layer via linq 2 entities, and the business layer will return data to the ui layer. Since the ui layer has no knowledge of the existance of the data layer, how would it handle a result of IEnumerable passed to it from the BLL, where T is defined in the data layer? Are there any GOOD example out there on how to do this. Please note that I'm extremely new to factories / interfaces / abstraction to loosely couple layers. I saw the question here http://stackoverflow.com/questions/917457/passing-data-in-an-ntier-application and it was recommended to have the entity layer shared amongst all layers... however I do not want the other layers to be able to query the database.

    Read the article

  • What is the best software to write and organize written copy / content for a website?

    - by johnqtaxpayer
    I'm a newbie product manager, looking for tips on how to write and organize text copy for my company's website. I need to be able to prepare the content for our public site and turn it over to the web designer who publishes it to our live site. I want our UI team to be able to quickly glance at the copy I write and immediately know where on the page I intend for it to go. Currently, I'm using microsoft word to write and color code different text to signify where I want specific text to go. It is difficult for the UI guy to immediately know if something goes into the nav bar or into a header or a description below a header. In addition to that, it would be helpful for me to be able to write the copy in such a way that the web designer could copy and paste it into the XHTML without having to go back and manually replace special punctuation characters with the XHTML entities. What software is out there that will allow a comprehensive solution to these web copywriting issues?

    Read the article

  • beginner Linq syntax and EF4 question

    - by user564577
    Question With the following linq code snip I get a list of clients with address filtered by the specifications but the form of the entities returned is not what i had expected. The data is 1 client with 2 addresses and 1 client with 1 address. The query returns 3 rows of clients each with 1 address Client 1 = Address1 Client 1 = Address2 Client 2 = Address3 var query = from t1 in context.Clients.Where(specification.SatisfiedBy()).Include("ClientAddresses") join t2 in context.ClientAddresses.Where(spec.SatisfiedBy()) on t1.ClientKey equals t2.ClientKey select t1; My expectation was a little more like a list with only two clients in it, one client with a collection of two addresses and one client with a collection of one address. Client 1 = Address1 / Address2 Client 2 = Address3 What am I missing??? Thanks!

    Read the article

  • NSPredicate aggregate function [SIZE] gives 'unsupported function expression' error

    - by jinglesthula
    iOS 4: I have entities in Core Data (using SQLite, which is a requirement) of: Request Response (which has a property personId) Revision Relationships are: Request <-- Revision Request <-- Response Revision <-- Response (e.g. each request may have many responses; each request/response pair may have many revisions) I'm trying to do a predicate to get all Responses with a given personId that have zero Revisions. Using: (personId == %d) && (Request.Revision[SIZE] == 0) in my predicate string gives me a runtime exception "Unsupported function expression Request.Revision[SIZE]" The documentation seems pretty sparse on aggregate functions, only noting that they exist, but with no syntax or examples. Not sure if it's my syntax or if the SIZE function really isn't supported in iOS.

    Read the article

  • why doesnt' nhibernate support this "exists in list" syntax ??

    - by ooo
    i have the following query and its failing in Nhibernate 3 LINQ witha a "Non supported" exception. Its similar to this question but this question was asked over a year ago so i am positive that the answer is out of date. My DB tables are: VacationRequest (id, personId) VacationRequestDate (id, vacationRequestId) Person (id, FirstName, LastName) My Entities are: VacationRequest (Person, IList) VacationRequestDate (VacationRequest, Date) Here is the query that is getting a "Non supported" Exception Session.Query<VacationRequestDate>() .Where(r => people .Contains(r.VacationRequest.Person, new PersonComparer())) .Fetch(r=>r.VacationRequest) .ToList(); is there a better way to write this that would be supported in Nhibernate? fyi . .the PersonComparer just compared person.Id

    Read the article

  • JPA @version - can it be used to calcualate version of a table entry

    - by OpenSource
    Hi, Please consider the following table (created using a corresponding entity) request ------- id requestor type version items 1 a t1 1 5 2 a t1 2 3 3 b t1 1 2 4 a t2 1 4 5 a t1 3 9 The above is what I want to achieve. The version field is a calculated field others are user provided. Basically the request's version needs to be calculated based on the combination of requestor and the type. The first occurance with a given combination will have a version 1 then version 2 and so on. I tried various things using @version on a different entity with just the three columns and joining the two entities using ManytoOne etc but I'm not able to get to the desired outcome. I dont want to confuse you with the things I tried. Since the objective is simple there should be an easier way I suppose? Can you please help? - any help greatly appreciated! thanks in advance

    Read the article

  • Accessing CoreData relationships

    - by georgeliquor
    I have the following core data model with two entities: entity "item" which holds name, date, description and a to many relationship "image". image is optional. entity "image" holds url, name and relationship to one item. I load the executed Fetchrequest into this NSArray "entityArray" This is what I do to display my data in a UITableView for example to display title in main cell: NSManagedObject *object = (NSManagedObject *)[entityArray objectAtIndex:indexPath.row]; cell.textLabel.text=[object valueForKey:@"title"]; Now I have no clue how to access my relationship image ([object valueForKey:@"image"]), because it contains more than just a string.

    Read the article

  • migrate/ update core data app without erasing user data!

    - by treasure
    hello, i have a very complicated problem that i would like to share with you and maybe someone can answer it for me. before i start i have to say that i am very new in this. So, i have a coredata iphone app (much like the recipes app) that uses a pre-populated sql database. The user can add/edit his own data but the default data cannot be deleted. the useres data are ALL saved in the same sql database. QUESTION: what do i have to do in order to: - update some (not all) of the default data that are stored in the sql database without "touching" the user's data? (the model will stay the same - no new entities etc-) (if the user uninstall the app and then reinstall the new version everything will be ok but i dont want to do this, obviously). can someone PLEASE help in coding level?

    Read the article

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