19
голосов
2ответов
19650 просмотров

What is the different between @Immutable and @Entity(mutable=false) when using Hibernate

What is the difference between the two if any? Should one or both be used on an entity?

1
голосов
1ответов
1442 просмотров

Setting an attribute on an entity and retrieving it with "one-to-many" relations

I have been through the Apple Developer guides and tutorials and I been through 2 iPhone books brushing on the subject of Core Data. I am used to handling the "value object"/"entity" side of things and then send them of to a web service or the likes. But on the iPhone I get to handle everything ...

0
голосов
2ответов
80 просмотров

Project to isolate entities in Seam

Is it possible to have a Seam project just for entities (src/main) and other projects access them ? I have a situation that a organization has 6 projects accessing the same entities and i don't want to replicate them in each project. If it is possible, how can i do that ? where can i found docu...

1
голосов
3ответов
130 просмотров

Where should I be creating the entity objects?

I have an entity class and an entity DAO class. Should it be the responsibility of the DAO class to create instances of the entity class, or should there be an entity creator/manager class that uses the DAO class only to get the data from the database to create the entity class. Thanks, Chris

0
голосов
2ответов
638 просмотров

How to limit fetching of entities from SQL query

SQLQuery query = session.createSQLQuery("select {o.id} from order o " + "LEFT JOIN bookings b ON b.id = o.bookingId " + ); List pusList = query.addEntity(Order.class) .list(); and in order class I have: @OneToOne(cascade = CascadeType.ALL, mappedBy = "order", fetch = FetchType....

1
голосов
1ответов
2439 просмотров

Is Hibernate entity callback methods are only called by using EntityManager

I used Spring's HibernateTemplate to save entity, I also add call back method like this @PrePersist public void prePersist() { setCreateDate(new Date()); } but I found this callback annotation was not called when I called saveOrUpdate() method. public void persist(Object entity) { ...

0
голосов
2ответов
683 просмотров

Problem with related entity on asp.net MVC create form using entity framework

I am building a very simple asp.net MVC file upload form. Currently I have a problem creating the new database object that stores info on said file. The code for the action method looks as follows: [Authorize(Roles = "Admin")] public ActionResult AddFile(Guid? id) { var org = or...

1
голосов
1ответов
6665 просмотров

Entities: Adding a Navigation Property between a View and Table

As you can seen in the diagram below there is a one-to-many relationship between the ProjectTask and Dependency table. Entities tries to map every field in the View to fields in the Dependency table, which wouldn't work. Any suggestions on how I can add the navigation property? Thanks, Abe ...

1
голосов
2ответов
897 просмотров

Any form generator(from annotated javabeans) for swing?

I've seen several form generators(swing, web etc from javabeans) but cannot find them again. Help me with links please. PS generator is not designer, generator - generates ui semi-automatically, no drawing is needed PPS I have finally found them nakedobjects jmatter metawidget if you know m...

1
голосов
1ответов
1679 просмотров

Will Firefox do XSLT on external entities?

What I'm trying to do is take an XML document, let's say http://example.org/data.xml and show it with an XSL stylesheet applied. (I cannot modify the document itself and add a directive) So there are a couple of utility XML files like this: wrapper.xml: <?xml version="1.0" encoding="UTF-8...

4
голосов
3ответов
2268 просмотров

Spring Entity to use Service, possible design flaw, but still

The legacy database I'm "springwrapping" has Id's that are Strings and that give away some information. For instance, a UserId looks like "DK-6715-00001", meaning a user in Denmark, postal code 6715. This is so wrapped into the enterprise applications that it needs to be kept and my entities veri...

10
голосов
6ответов
28945 просмотров

Data reader is incompatible... member does not have corresponding column in data reader

Using VS 2008, SQL Server 2008 and WPF 3.5, I've made some changes to my schema and updated the model. It compiles and runs fine, until the client app calls for a specific entity and I get the following (actual names replaced): The data reader is incompatible with the specified '<Model>.&...

0
голосов
3ответов
2642 просмотров

Security Exception using MySQL and Entity Framework on godaddy

We are getting a SecurityException when using Entity framework on godaddy. The entity has been configured against a MySQL store. (v. 6.1.2) A bit of weirdness with the exception though... Looking at the exception stack it seems to imply that if we open up a connection to MySQL anywhere in the ...

0
голосов
1ответов
324 просмотров

How do get reference to a related parent object when selecting a list of child objects using entity framework

Using EF how do i access values in a parent property when accessing a list of child objects. i.e. I have a Project object and Timesheet object Project Id Name ... TimeSheet ProjectId UserId Date TimeSpent ... I understand how to get back a Project and its related Timesheets but what if I want...

0
голосов
3ответов
3735 просмотров

Entity Framework, Stored Procedures,ASP.NET GridView - Insert Empty Row

I want to add a empty row in my Grid. <asp:TemplateField> <ItemTemplate> <asp:ImageButton id="Insert" runat="server" CausesValidation="false" CommandName="Insert" OnClick="GridViewInsert" ImageUrl="~/Images/Grid/Insert.gif" /> In GridViewInsert Event: Awar...

0
голосов
2ответов
215 просмотров

Retrieving dependent/parent from within domain entity method

How would one go about retrieving a dependent/parent object from an entity. $person->getAddress(); This should retrieve the Address object for that person from the database and return it as an object. Is this a good way to do it and how should the code look like if this is ok to do. Doing ...

1
голосов
1ответов
3469 просмотров

(Fluent) NHibernate - problem mapping Id

I have a problem mapping an Id. The structures of the entities are as follows: public abstract class Entity<TEntity, TId> where TEntity : Entity<TEntity, TId> { public virtual TId Id { get; protected set; } public override bool Equals(object obj)... ... } public clas...

2
голосов
4ответов
8799 просмотров

‘ “ é == ‘ “ é, but on what encoding/reference?

I have a ColdFusion script that does: <cfset content = replace(content,"&##147;","""","all")> Which replaces &147; by ". Google understands this too, if you type ‘ “ é at its search box its transformed on the results page to ‘ “ é". If I search for é o...

1
голосов
1ответов
670 просмотров

Hibernate mapping inheritance

I have a class ClassA mapped to TableA. I also have a mapping for it and it has an entity-name of EntityA. Now, I need to create another mapping named EntityATwo between ClassA for TableA, but slightly different. Although I could copy-paste the mapping of EntityA to EntityATwo, it would be ver...

9
голосов
3ответов
2596 просмотров

DDD: subclasses & root entities

Let's say I have the typical entity Car class Car : Entity { public double MaxSpeed { get; set; } public Color Color { get; set; } /* ... */ } This entity, in my domain model, would be the root entity of an Aggregate. Now let's say I specialize cars. I create a Ferrari, and the ha...

4
голосов
2ответов
1847 просмотров

Separate table for Value Objects on NHibernate

I'm new to DDD and NHibernate. In my current project, I have an entity Person, that contains a value object, let's say Address. Today, this is fine. But maybe one day I will have a requirement that my value object (in this case Address), will have to become an entity. Before trying to model thi...

0
голосов
1ответов
2809 просмотров

Bind Infragistics UltraWebGrid with Hierachical view to collection of objects

I have a list of entities that i want to bind to my UltraWebGrid. The Class definition of the entity has the following structure public class Parent { public Guid Id { get; set; } public String Name { get; set; } public IList<Child> Children { get; private set; } } public class Chil...

13
голосов
2ответов
16136 просмотров

Get annotated hibernate tablename from POJO

I have an entity which is declared roughly like: @Entity @Table(name = "myUserTable") public class User implements Serializable { ... } I'm making a generic DAO class, and in doing so I'd like to retrieve the "myUserTable" name. Is there any way I can reach this name?

-1
голосов
2ответов
806 просмотров

Is there a way to manually raise the PropertyChanged event of an EntityObject?

Hi I am trying to raise the PropertyChanged event of an EntityObject, I don't find a way to do it, is this possible?

1
голосов
2ответов
1421 просмотров

Linq to Entities - Retrieve entity with "self-reference" from Stored Procedure

I can't quite figure this out. I have a table called Employee with and Id field. The table also contains a ManagerId field which has a foreign key pointing to the Employee's Id field. When I add the table as an entity to my entity data model it creates the new Employee entity with an EmployeeChil...

0
голосов
1ответов
2572 просмотров

how to get child table along with the parent in entity framework using entity sql like "select value tablename from tablename"

how to get child table along with the parent in entity framework using entity sql query for example var parentTable = "select value parentTable from parentTable as pt inner join childTable as ct on pt.key = ct.key"; doing this parentTable.childTable.count() returns 0. so how can i get the chil...

0
голосов
1ответов
368 просмотров

What am I missing with my Entity Framework?

I have asp.net membership and I use the built in Create user method since it is convenient now after this depending on the user I want to add 2 more fields to the aspnet_UserTable. In my aspnet_user Table I have like this // All Standard Fields that come with this table ClubID<nullable) Clu...

0
голосов
1ответов
202 просмотров

Dropdownlist and Entity objects

I'm using Entity Framework and I want to bind a list of one of them to a dropdownlist. This is working well. But there's just one problem. What is the best practice to go to an outter object linked to the entity listed? I.E: A command which have ID, date, refCandidatID, etc. and for some reason,...

4
голосов
4ответов
6001 просмотров

Linq 2 Entities : Performing a join on two columns with different types

I'm currently using Entity framework, and I want to perform a Linq query with a join on two columns, one being of type 'String', and the other of type 'Int32'. Somethign similar to from FirstEntity obj in context.FirstEntity join SecondEntity obj2 in context.SecondEntity ...

2
голосов
2ответов
897 просмотров

ADO Entity hierarchical self referencing

I have a self referencing table named categories that has a parentcategoryid column that is nullable. When I added the table to the entity designer it created two navigation properties for this relationship and I named one ParentCategory (the zero or 1 nav prop) and the other I named SubCategori...