I'm using this DAO class which was generated by Hibernate Tools:
/**
* Home object for domain model class Empleados.
* @see com.hibernate.Empleados
* @author Hibernate Tools
*/
public class EmpleadosHome {
private static final Log log = LogFactory.getLog(EmpleadosHome.class);
private final SessionFactory sessionFactory = g...
I just discovered PHP-ActiveRecord not too long ago after struggling for nearly a month to write my own ORM (I'm hard headed like that) and I fell in love with it. I had looked at Doctrine and Propel before but decided to run away due to the sheer complexity and learning curve. With AR, I don't have the anxiety and learning difficulty I ...
Don't get me wrong - OOP currently is the best thing to structure large code bases.
But why do people try to stuff anything into an OO view?
For example: each text book about OOP contains an "introducing example" that tries to express a small view of our real world in an OO inheritance and composition and aggregation construct. And - m...
I have seen something like this in an ORM:
$b = new Book();
$b->limit(5)->get();
echo 'ID: ' . $b->id . '<br />';
echo 'Name: ' . $b->title . '<br />';
echo 'Description: ' . $b->description . '<br />';
echo 'Year: ' . $b->year . '<br />';
foreach ($b as $book)
{
echo 'ID: ' . $book->id . '<br ...
I have a multilevel inheritance model in JPA that is using the joined strategy
@Entity
@Table(name="PARTY")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="PARTY_TYPE",discriminatorType=DiscriminatorType.STRING)
public class Party implements Serializable{
...
}
@Entity
@Table(name="PARTY_ORG")
@DiscriminatorVal...
Hi there,
I have a question about Hibernate ManyToMany mappings. I have two classes A and B and the mapping between them is a ManyToMany mapping resolved by Hibernate:
@Entity
@Table(name="A")
public class A {
@Id
@GeneratedValue
private Long id;
@ManyToMany
@JoinTable(name="C", joinColumns=@JoinColumn(name="a_id"...
Weird stuff... I have happily used EclipseLink / JPA 2 as provider for my persistence unit for a while (with a MySQL RDBMS in the back). I had DDL-drop/create turned off, since I wanted to keep records in the DB and there weren't any changes to the Entities anyway.
Now I've just made some bigger changes to one Entity (adding some attrib...
Can you have an MVC without an ORM?
...
Hello, guys!
In my project I'm using EntityFramework 4 for working with data. I found horrible performance problems with a simple query. When I looked at the profiler on a sql query, generated by EF4, I was shocked.
I have some tables in my entity data model:
It looks pretty simple. I'm trying to select all product items from specif...
Consider the following Parent class that has two ManyToOne references.
@Entity
@Table(name = "PARENT")
public class Parent {
private static final long serialVersionUID = 3730163805206219313L;
@Id
@SequenceGenerator(name = "SEQ#PARENT", sequenceName = "SEQ#PARENT", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE,...
I learnt Hibernate and used it to reduce my Java code to a vast extent and also able
to reduce the time spent for DB's. Now what type of query should i use to finish my
operations for getting a DB list to be displayed, to update and delete.
My code for deletion is
String newToken = "DELETEUSER";
if(!TokenManager.checkRoleToken(newTo...
If I use an ORM let's say with Zend or Symfony. Is it an all or nothing deal?
I'd like to use the ORM, but also want to optimize performance in some cases and write the query myself to get to the nitty gritty. So if I start using an ORM, is it going to be difficult to do it the old way once I include it in my project?
...
I have the following entities:
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="orderType", discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue(value="BASE")
@Table(name = "orders")
public class OrderEntity implements Serializable {
...
and
@Entity
@DiscriminatorValue(value="RECURRING...
I am new to Hibernate. Please tell me what is the use of getHibernateTemplate().flush() and how it works.
...
Hi, I want to create Many-One Mapping between two tabels, Expense(ID, NAME, CATEGORY) and
Category(ID, NAME).
In my class i have created a field 'Category category' and its setters and getters.
I did them after seeing some stuff from internet. What are all the changes i have to do in my Category.java class. For now, its looks like,
pub...
Hello Hibernate daemons,
I have inheritance in Hibernate for where Connection is my parent entity, and MobilePhoneConnection is extended entity. I used one table per subclass strategy for inheritance mapping. This is my file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3...
I'm using YAML to define the doctrine schema and would like to start the id field that's set on auto-increment with a number other than 0, let's say 324 (this is done in mysql by doing something like AUTO_INCREMENT=324.
This Google groups thread has a hint that it may be possible to do with command.pre_command event to execute the SQL b...
Hello everyone,
I am totally lost in implementing the following sql using cakephp ORM
SELECT *
FROM users
WHERE users.id NOT
IN (
SELECT potentials.user_id
FROM potentials
)
I have tried this but it is not working at all
$this->User->find('all', array(
'contain' => array(
'City' => array(
...
If you're aware of a CMS that uses an ORM (either their own or one of the well-known ones), please list the CMS here with the name of the ORM it uses.
If you know that the CMS you use DOESN'T use ORM, please also say so.
...
I know that you can get the SQL of a given QuerySet using
print query.query
but as we know from a previous question ( http://stackoverflow.com/questions/2926483/potential-django-bug-in-queryset-query ) the returned SQL is not properly quoted. See http://code.djangoproject.com/browser/django/trunk/django/db/models/sql/query.py
Is ther...