2
голосов
6ответов
8047 просмотров

Using entity id as a reference in Hibernate

I would like to hold a ref of some other entity using its identifier. The object model which I am working on is huge and related entities hold lot of data. Also few pieces are cyclic in nature and I suspect that holding objects directly will be a problem. So consider following as an example sa...

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

Deleting Objects with JPA with Foreign Key Constraints

I have a two classes, Service and Customer, with a many-to-one association from Service to Customer. I want to delete a Customer and any Service that references it. I'm using JPA as the ORM (with Hibernate underneath) attached to a PostgreSQL db. It'd be great if I could define the association i...

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

Mapping Calculated Fields in Hibernate

I'm not sure if this is possible in Hibernate but it would be really great if it was :) I've not actually got past the conceptual stage with this but I'll explain as best as I can. I want to make use of Oracle Spatial features to do proximity based searching. Imagine I've got a Location entity w...

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

NHibernate and many to many mapping

I have 3 tables organization(id, name, and etc) organizationContact(organizationId, contactId, status) contact(id, name, email) How can I make a many to many mapping and use status column from organizationContact?

5
голосов
2ответов
2313 просмотров

Must two SQLAlchemy declarative models share the same declarative_base()?

Is it necessary for two SQLAlchemy models to inherit from the same instance of declarative_base() if they must participate in the same Session? This is likely to be the case when importing two or more modules that define SQLAlchemy models. from sqlalchemy.ext.declarative import declarative_base ...

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

How to Properly Enforce Correct Usage of a Class Method?

Our current ORM solution uses Data Mappers to represent tables / views in the database which then return a Collection object that can be used to iterate through the retrieved records as Model objects. Between the Data Mapper and Model layers is a Repository layer that handles domain requests to t...

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

MySQL dot-traversal... possible?

So I'm working on a CMS that will allow users to "traverse" through database tables. I'm having some trouble implementing it though, and am wondering if anyone has any suggestions. Table: house name (varchar), town (relationship, using the rel table) Table: town name(varchar), state (relations...

3
голосов
5ответов
3353 просмотров

ORM for Oracle pl/sql

I am developing a enterprise software for a big company using Oracle. Major processing unit is planned to be developed in PL/SQL. I am wondered if there is any ORM like Hibernate for Java, but the one for PL/SQL. I have some ideas how to make such a framework using PL/SQL and Oracle system tables...

3
голосов
3ответов
970 просмотров

Django database scalability

We have a new django powered project which have a potential heavy-traffic characteristic(means a heavy db interaction). So we need to consider the database scalability in advance. With some researches, the following questions are still not clear to us: coarse-grained: how to specify one db tabl...

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

Strongly typed .net -> sql data access?

I know what i want but not sure of the name and required tools so here goes... I have a few different sql tables. I want a tool that will generate an object in my .net project for each table, with each column a property of this object. (i.e. strongly typed, no datatables) I want to be able to ...

5
голосов
7ответов
911 просмотров

DDD: Should everything fit into either Entity or Value Object?

I'm trying to follow DDD, or a least my limited understanding of it. I'm having trouble fitting a few things into the DDD boxes though. An example: I have a User Entity. This user Entity has a reference to a UserPreferencesInfo object - this is just a class which contains a bunch of propertie...

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

eliminating unnecessary database hits in django

I'd like to reduce actual database hits when working in django so I've created this artificial example to outline the problem. The model looks like this: class Car(models.Model): name = models.CharField(max_length=10) user = models.ForeignKey(User) In my view I want to do something lik...

1
голосов
7ответов
1966 просмотров

what is the best code generator for NHibernate?

what is the best code generator for NHibernate?

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

Datetime in java and default datetime mapping in hibernate

I need some little help about a confusion i'm having. since i came from C# .NET i was expeting java to have something similar to C# DateTime. While i manage to create a helper method to convert string representation of date like eg "2009-10-16 11:14:34" to date object. here is the method publ...

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

Fluent NHibernate: rarely used properties as Component, or in seperate table?

I wonder if you could help me with something I've been thinking about. Say we have an Entity. Say the endtity has an ExtendedInfo object, which contains various properties which are not often used. I'm wondering how best to structure this for FNH. The easiest thing to do I suppose would just ...

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

Fluent NHibernate: mapping one-to-one

NHibernate seems to support a special case of one to one mapping (That doesn't require a 1-m mapping on each side of the relationship). See this article by Ayende: http://nhibernate.info/blog/2009/04/18/nhibernate-mapping-lt-one-to-one-gt.html I have no idea how to specify this in Fluent NHibe...

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

What ORM frameworks for .NET and Oracle Do You Like Best?

What ORM frameworks for .NET and Oracle Do You Like Best?

22
голосов
4ответов
24929 просмотров

ORM Technologies vs JDBC?

My question is regarding ORM and JDBC technologies, on what criteria would you decide to go for an ORM technology as compared to JDBC and other way round ? Thanks.

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

doctrine orm: bypass lazy loading and prefetch related records in a getter

Working with Doctrine ORM, is it possible to enable auto eager loading of related records when using in a getter ? (without explicit leftJoins()) I know I can use a leftJoin() to obtain the object with related records, but I want to avoid creating a DQL query for every object and simply have so...

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

Inserting two related objects fail in SQLAlchemy

I'm getting the (probably trivial) error, but completely clueless about the possible causes. I want to insert two object in the DB using SQLAlchemy. Those objects are related, here are the declarations. Class User: class User(Base): __tablename__ = 'cp_user' id = Column(Integer, Sequenc...

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

best way to map linq2sql objects to entities

I have been doing this: public List<Role> GetRoles() { List<Role> result = new List<Role>(); foreach (var r in Db.tblRoles) { result.Add(new Role() { Description = r.d, Id = r.Id, ...

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

Unit testing Linq 2 Sql lazy-loaded properties

Lets say I have a Customers table and an Orders table with a one-to-many association (one customer can have multiple orders). If I have some code that I wish to unit test that accesses a specific customer's orders via lazy-loading (e.g. a call to customer.Orders), how do I mock / stub that call ...

5
голосов
3ответов
4381 просмотров

How do you check if a table exists with NHibernate(or Fluent)?

Whats the best, most consistent way to check if a table exists in NHibernate (or with Fluent-NHibernate)? Is it even possible? I mean it seems like a simple task for such a heavy-duty ORM. Also on a related question, can you check if a set of tables or a whole schema exists with NHibernate?

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

Complex ordering in Django

I have a Django model for Cat which has a foreign key Dog. The Dog model has a date key timestamp. I want to order the cats, using Cat.objects.order_by, according to the timestamps of their respective dogs. How do I do that?

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

in .net what class(s) should I use to make working with data from DB easy (not including Entity Framework or LINQ)

QUESTION 1 - What .NET classes should I be looking at to help me read / update some data in a database, but assuming I'm not using LINQ or Entity Framework. That is if you drop back to the core .net framework what are the key classes to use. In particular something that lets me access data fr...

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

Ruby - Working with Mechanize::File response without saving to disk

I'm working on my first ORM project and am using Mechanize. Here's the situation: I'm downloading a zip file from my website into a Mechanize::File object. Inside the zip is a file buried three folders deep (folder_1/folder_2/file.txt). I'd like to pull file.txt out of the zip file and return ...

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

Execute "MEMBER OF" query against 'ElementCollection' Map fields in JP-QL (JPA 2.0)

Is it possible to run a "MEMBER OF" query against associative arrays? If so, what does the syntax look like? The obvious workaround is a native query but that gets pretty messy what with all the joins and such. I'd like to test for existence of an object within the map's key set, value collect...

7
голосов
3ответов
5314 просмотров

kohana transaction with orm

is it possible (how) to use mysql transactions and rollbacks using kohana ORM ?

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

Which ldap object mapper for python can you recommend?

I have to synchronize two different LDAP servers with different schemas. To make my life easier I'm searching for an object mapper for python like SQLobject/SQLAlchemy, but for LDAP. I found the following packages via pypi and google that might provide such functionality: pumpkin 0.1.0-beta1: P...

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

Hibernate mapping for situation, where the the key is also used as many-to-one parameter

I was wondering if there is a way to do Hibernate mapping for the following. My two days spent on this say there isn't. There are two tables, having one to many relationship. +---------------------+ +-----------------+ | versioned_entity | | basic_entity | +-------------------...