I have a jar on the classpath which contains a hibernate.properties. This causes problems when my app starts because hibernate tries to use the settings from this file. Is there a way to explicitly specify the file that hibernate should look for, or tell it to ignore the properties file in the dependency jar?
...
Following suggestions, I am converting my project to declarative sqlalchemy class definitions. This allows me to define relations as strings ( a=relation('myotherclass'), instead of relation(myotherclass) ), and avoid cross importing issues.
My question is how do I define column_properties the same way.
This is sort of what I have (no...
I'm piggy-backing off of http://stackoverflow.com/questions/2368195/how-to-join-tables-in-unidirectional-many-to-one-condition.
If you have two classes:
class A {
@Id
public Long id;
}
class B {
@Id
public Long id;
@ManyToOne
@JoinColumn(name = "parent_id", referencedColumnName = "id")
public A parent;
}
...
I have some code:
@Id
@SequenceGenerator(name = "SOMETHING_SEQ")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SOMETHING_SEQ")
@Column(name = "SOMETHING", nullable = false)
private Long id;
How is hibernate providing my id?
I see in my database there a single sequence named 'hibernate_sequence' and no other hibern...
Are there any tools that can look at a database, and generate the basic mapping files?
It would be great if it could take a database, and create the actual model (java classes) with annotations, but not sure if that exists?
...
Hi,
I have this mapper defined:
mapper(Resource, resource_table,
properties = {'type' : relation(ResourceType,lazy = False),
'groups' : relation(Group, secondary = model.tables['resource_group'],
backref = 'resources'),
'parent' : relation(Relation, uselist=False, primaryjoin =
and_(relation_table.c.res_id == resourc...
Hello,
I've got the problem, that I use a property in the persistence.xml which forces Hibernate to look only for tables in the given schema.
<property name="hibernate.default_schema" value="FOO"/>
Because we are using now 4 different schemas the actual solution is to generate 4 war files with a modified persistence.xml.
That not v...
Hello
I'm trying to use Django's ORM in my non-HTTP part of project.
In one function I need to make bulk inserts of data, so commit_on_success decorator is what I need.
But I've found that this decorator doesn't do what supposed (didn't rollback transaction on error).
I've go into this decorator with debugger, I've fount thar reason...
Hello, been searching a lot information about IoC/DI development, but I haven't found much information how to integrate an ORM into the IoC/DI development.
Should the IoC know about the ORM? Or vice versa?
How does the IoC configuration mapping work when mapping a "ORM type"?
Example:
public class Person : IPerson
{
private IPer...
Does anyone know if there are any ORM tools or Code Generation tools that work against an Advantage Database?
...
I am starting to delve into the realm of ORMs, particularly NHibernate in developing .NET data-aware applications. I must say that the learning curve is pretty steep and that a lot of things should be noted. Apparently, it actually changes the way you do data-aware applications, manner of coding, development and just about everything.
...
I'm trying to unit test my DAO which uses the Criteria API. The Criteria object I have has a number of expressions and returns a unique result.
The problem I have is that when I use Jmock to create an expectation I have to create one for the criteria.uniqueResult() command and I have to set a return type. The return type is a custom ty...
I'm pretty new to database development in general and I've never used ORM before. I'm interested in the benefits of using one, specifically saving time writing boilerplate SQL queries. I'd like to use ORM for a project that I'm working on right now, but I'm not sure it's applicable.
This project is more akin to change tracking for very ...
I'm using JPA but I'm not sure how to use it for
relation between two classes. I need to connect them
@OneToMany. I have done this before but forgot.
Is there any good tutorial for this or an example that
is easy to understand.
By the way this is a Flex application where I'm using
BlazeDS for connection between Java and Flex.
...
I'm teaching JEE, especially JPA, Spring and Spring MVC. As I have not so much experience in large projects, it is difficult to know what to present to students about optimisation of ORM.
At the present time, I present some classic optimisation tricks:
prepared statements (most of ORM implicitely use them by default)
first and second-...
I'm trying to figure out if there's a way to do a somewhat-complex aggregation in Django using its ORM, or if I'm going to have to use extra() to stick in some raw SQL.
Here are my object models (stripped to show just the essentials):
class Submission(Models.model)
favorite_of = models.ManyToManyField(User, related_name="favorite_sub...
I am using hibernate to update 20K products in my database.
As of now I am pulling in the 20K products, looping through them and modifying some properties and then updating the database.
so:
load products
foreach products
session begintransaction
productDao.MakePersistant(p);
session commit();
As of now things are pretty s...
I've done quite a bit a research on this with no luck, but all the answers have a tendency to point toward the session context settings in the config file. What is odd is that I get a session connection the very first time I hit the page (and therefore, a successful result set), but then when I reload I get the following exception: org.h...
How can I update an entity "effectively" in hibernate just as by using SQL.
For example : I have a Product entity, which has a field name createTime. When I use session.saveOrUpdate(product) I have to get this field from database and then set to product then update, actually whenever I use session.saveOrUpdate(), I updated ALL fields, ...
Can someone help/guide me with using SQLite lib on Linux (MONO) and Windows (.NET)
On linux i use native mono sqlite client, and on windows i use http://sqlite.phxsoftware.com/
is there a way to define 'using' directives like this :
#if (linux)
using Mono.Data.Sqlite;
#else
using System.Data.SQLite;
Another problem is small diff...