orm

doctrine findby relation

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 doctr...

hibernate query language or using criteria

Any one who tell me the query using criteria/hql/sql. Requirement is that user enter email or username the query return the password of the user from table user. ...

Hibernate Auto-Increment not working

I have a column in my DB that is set with Identity(1,1) and I can't get hibernate annotations to work for it. I get errors when I try to create a new record. In my entity I have the following. @Entity @Table(schema="dbo", name="MemberSelectedOptions") public class MemberSelectedOption extends BampiEntity implements Serializable { ...

Java: JPA classes, refactoring from Date to DateTime

With a table created using this SQL Create Table X ( ID varchar(4) Not Null, XDATE date ); and an entity class defined like so @Entity @Table(name = "X") public class X implements Serializable { @Id @Basic(optional = false) @Column(name = "ID", nullable = false, length = 4) private String id; @Column(name ...

Hibernate Query for a List of Objects that matches a List of Objects' ids

Given a classes Foo, Bar which have hibernate mappings to tables Foo, A, B and C public class Foo { Integer aid; Integer bid; Integer cid; ...; } public class Bar { A a; B b; C c; ...; } I build a List fooList of an arbitrary size and I would like to use hibernate to fetch List where the resulting list will look so...

PHP ORM Solution for SqlServer

I am searching for DAL or ORM (Only ORM no MVC) Solution in PHP5 that can efficiently access SqlServer. I am new to SqlServer. and I need to code a part of ASP.net website in PHP5. I am currently Using QCodo However its codegenerator is making some problem with ASP's own tables (?? the ASP Guys told me that its for ASP's Membership Manag...

.NET ORM and Security

We're going to use an ORM tool with a .NET desktop application. The tool allows creation of persistent classes. It generates all database tables automatically. In addition to other data, our system needs to store user credentials, and deliver access control. The question is, is there any possibility of access control by means of ORM, w...

How to set up precision attribute used by @Collumn annotation ???

I often use java.lang.Integer as primary key. Here you can see some piece of code @Entity private class Person { private Integer id; @Id @Column(precision=8, nullable=false) public Integer getId() { } } I need to set up its precision attribute value equal to 8. But, when exporting The schema (Oracle), ...

Entity Framework conditional mapping operator other than = and is

Is it possible to create an EntitySet with a conditional mapping other than Value or IsNull? Suppose we have have a Product object with a field DateTime Expiration. I want to have ExpiredProducts and ActiveProducts based on Expiration>DateTime.Now so I can query like this: var expired = from p in ExpiredProducts select p; ...

Mapping tables from an existing database to an object -- is Hibernate suited?

Hello! I've got some tables in an existing database and I want to map them to a Java object. Actually it's one table that contains the main information an some other tables that reference to such a table entry with a foreign key. I don't want to store objects in the database, I only want to read from it. The program should not be allow...

"Dealing with uncertainty" - Entity Framework CodeOnly

This is a bit of a strange one but I've just seen something on twitter which kind of baffled me and I'm interested to know more. Rob Conery tweeted the following a couple of hours ago: Class name of the day: "Maybe<T>". Method of the day: "ToMaybe<T>()". He then went on to offer a Tekpub coupon to anyone who could guess where it came f...

What ORMs work in medium trust?

Environment: C#, MySql, GoDaddy Shared Hosting (medium trust). Assuming the above environment, what ORMs will work in a medium trust environment? Also consider the following features: minimal code changes to the ORM library. minimal disabling of features to run in medium trust. Bonus feature: fluent interface There are a lot of ...

Django QuerySet ordering by expression

How can i use order_by like order_by('field1'*'field2') For example i have items with price listed in different currencies, so to order items - i have to make currency conversion. class Currency(models.Model): code = models.CharField(max_length=3, primary_key=True) rateToUSD = models.DecimalField(max_digits=20,decimal_pla...

JPA Is there a way to do something like SELECT <field>, count(*) FROM <table> GROUP BY <field>

I've been looking in the web for examples on the aggregates like count but it seems all of them are using the aggregate alone. SELECT field, count(*) FROM table GROUP BY field Should have something like: field.value1, x1 field.value2, x2 .... I'm looking for a pure JPA answer for this one. If not I guess I can then do further queri...

Are there any modeling tools that help visualize how a 3NF model would look like against EAV?

Would like to find low-cost relational modeling tools that will allow me to map a logical model in third normal form to a physical model based on EAV. Got any pointers? ...

Access one database from multiple ORMs :: Caching issue

I know this is not a good idea and the best would be to let the applications talk Web Services. But I have a situation where the legacy application is accessing a database with an ORM and I need to access the same database from the new .net application using Fluent nHibernate. So the question is what problems this will make and how to s...

JPQL: What kind of objects contains a result list when querying multiple columns?

Hello! I'm trying to do something which is easy as pie in PHP & Co: SELECT COUNT(x) as numItems, AVG(y) as average, ... FROM Z In PHP I would get a simple array like [{ numItems: 0, average: 0 }] which I could use like this: echo "Number of Items: " . $result[0]['numItems']; Usually in JPQL you only query single objects or single co...

Is there an ORM with APIs to be used programatically?

Is there any ORM that offers APIs to be used programatically? In my situation, a user will be helped through a wizard to define some entities. Thereafter those entites will be created in a database in form of tables (there will of course be some improvization). I need an ORM that offers APIs for modeling and creating entities during ap...

Which .NET ORM has best support for PostgresSQL database

I'm interested to find out which ORM has best support for Postgres SQL database? Does any mapper have, both, LINQ support and ability to generate model from database? ...

Is there any new ORM for Delphi 2010?

Delphi 2010 has new features regarding the RTTI, which I read it will make it easier for ORM tools and much cleaner code. but I have not found any ORM incorporated these features. Do you think the Embarcadero should built one and include it with Delphi ...