orm

Kohana 3 ORM: Read additional columns in pivot tables

I'm using Kohana v3 and ORM, I have two models, Model_A and Model_B related by "has_many" through a pivot table, which has an additional column. I can save data in that column in the pivot table using the third parameter of the add() function, but I can't figure out how to read that column using ORM. Any ideas? Thanks in advance. ...

rewriting a SQL/vb6 app - should I use nHibernate or Linq

Hi experts, I have a legacy VB6 app which I am rewriting in .Net. I have not used an ORM package before (being the old fashioned type who likes to know what SQL is being used), but I have seen good reports of NNibernate and I am tempted to use it for this project. I just want to check I won't be shooting myself in the foot. Because my ...

spring - hibernate load *.hbm.xml from classpath resource

I have some hbm.xml files in classpath resource located in src/main/resources maven's folder. I used spring's LocalSessionFactoryBean to load these files with the following bean config: <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSourceOracl...

Django Generic Relations and ORM Queries

Say I have the following models: class Image(models.Model): image = models.ImageField(max_length=200, upload_to=file_home) content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey() class Article(models.Model): text = models.TextField() ...

What does an Asynchronous ORM mean

What does an Asynchronous ORM really mean ? How does it differ in behaviour from a regular ORM ? Where can it be used ? ...

How to make NHibernate <array> to have fixed size

I'm using a mapping of IList to array in NHibernate, and I want the array to always have constant, fixed size. However, it is valid that some elements in the array are null. I noticed that in this case, NHibernate truncates the null elements at the end of the array. How can I enforce it to always set the array to appropriate size when ...

Unsupported SQL Type 1111 when passing String to a VARCHAR field

I have been smashing my head against this for a while now. I am using iBatis with my JAVA code to run Stored Proc residing in Sybase DB. Stored procedure is expecting some parameters. few of them are declared as VARCHAR (6) So in my iBatis mapping i did the following for those parameters. <parameter property="searchUserId" jdbcTyp...

ORM-like library for C

Hello Everyone. I have been looking for a ORM library for C(I was thinking about something like ActiveRecord on Ruby) and I can't find any. I was wondering if someone has ever heard of one and could let me know. Thanks in advance. Eduardo Sorribas ...

Is SqlMetal a good solution for mapping to a database that contains *only* tables?

I'm thinking of using SqlMetal to auto-generate LinqToSql code for a simple and small database. The database will have only tables with some primary and foreign keys (i.e., no views, stored procedures, functions, etc.). I'd like to do all joins, grouping, sorting, and advanced data manipulation using Linq. I have experience with LinqToO...

Must developers care about possibility of changing ORM in future?

Let's imagine I start to develop a project. So must I seriously care about possibility of changing ORM in future? Or, more precisely: Would you like to change the ORM you use in your current project to some different one. If yes, what are the reasons? Have you ever practically did this? If so, what were the reasons? Speaking pract...

ORM alternatives to ActiveRecord

To begin with this post in no ways undermines ActiveRecord. I am pretty happy with it, but for the sake of knowledge and to try a few options are there any other alternatives to ActiveRecord available? Has anybody used some other ORM than ActiveRecord, if yes then which ORM is that? Please share your experience. ...

How does ORM work when using PDO in PHP?

I've heard that PDO can do some ORM. Is it a good idea to stick with that or should I consider some alternatives that use PDO to do ORM? In short, what I want to do: I want to automatically map table fields to instance variables. Getters and Setters are created manually. However, I could also think of making an associative array as ivar...

Basic ORM strategy in PHP: How could it look like?

Basic ORM strategy in PHP: How could it look like? ...

Best ORM that can work with Service Broker and transactions

Greetings Is there a ORM (MS-Sql specific) that can work with transactions and is Service Broker friendly. What I’m searching for is the ability to work with the ORM tables, inside a transaction, and be able to do service broker calls inside the transaction (either by using an ORM object/method or by directly executing a command.Execute...

which SessionFactory should be use for transactionManager?

<bean id="projectService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager" ref="transactionManager"/> <property name="target"> <bean class="com.company.project.company.services.ServiceImpl" init-method="init"> <property name="HRappsdao" ref...

ColdFusion9 orm properties in script

I'd like to write the following in script syntax rather than the old style tag syntax. <cfcomponent persistent="true" table="AuditType" schema="Audit" > <cfproperty name="AuditTypeID" column="AuditTypeID" ormtype="int" fieldtype="id" /> <cfproperty name="AuditTypeName" column="AuditTypeName" ormtype="string" /> <cfproperty ...

Why hibernate session.close() does not flushes the data automatically?

When hibernate closes a session, the purpose of close is basically to close the underlying connection and the clean up the first level cache. Why the flush also does not happens automatically here? ...

What does a Data Mapper typically look like?

I have a table called Cat, and an PHP class called Cat. Now I want to make a CatDataMapper class, so that Cat extends CatDataMapper. I want that Data Mapper class to provide basic functionality for doing ORM, and for creating, editing and deleting Cat. For that purpose, maybe someone who knows this pattern very well could give me some ...

Duplicate a collection of entities and persist in Hibernate/JPA

Hi, I want to duplicate a collection of entities in my database. I retreive the collection with: CategoryHistory chNew = new CategoryHistory(); CategoryHistory chLast = (CategoryHistory)em.createQuery("SELECT ch from CategoryHistory ch WHERE ch.date = MAX(date)").getSingleResult; List<Category> categories = chLast.getCategories(); chN...

What exactly is "persistence ignorance"?

Persistence ignorance is typically defined as the ability to persist & retrieve standard .NET objects (or POCOs if you really insist on giving them a name). And a seemingly well accepted definition of a standard .NET object is: "...ordinary classes where you focus on the business problem at hand without adding stuff for infrastructur...