Hi!
I wanted to force hibernate to use innodb.
So, i changed the "hibernate.dialect" in order to have innodb, but i can connect to mysql, but when i do some transactions i have the following error:
org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.Rol...
i have the following criteria specification and wanted to know if there is any difference in the performance or the memory usage of them.
1st way:
criteria.add(Restrictions.eq("case.estadoOperativo", Caso.EstadoOperativo.COMPLETADO))
.add(Restrictions.eq("case.estadoAdministrativo", Caso.EstadoAdministrativo.TARIFICADO));
2nd ...
What is the best/prettiest/most flexible way of storing application settings with Hibernate?
Is a single row table the way to go, or is there a better way? The ability to store extra settings in the same place/table, but outside of the application domain would be nice.
I've experimented with a Key/Value table, for example:
Key | ...
I have three classes that need to be related, and I'm not sure how to do it.
The User class, is of course for a user, Game represents a game, GameTurn represents a turn in the game. Game belongs to a user, the user who initiated the game, and GameTurn belongs to a user, the user who played that turn.
What I want to do is associate User...
How do I load a collection of entities of a given class, with only a single trip to the database, e.g.:
public Collection<Object> getEntities(Class<?> entityClass,Collection<Serializable> listOfIDs);
I know that if I were only wanting to fetch a single entity, I could use:
sessionFactory.getCurrentSession().get(Class,Serializable);
...
I have build my data model using JPA and am using Hibernate's EntityManager 3 to access the data. I used HSQLDB for testing (junit). I am using this configuration for other classes and have had no problems.
However, the latest batch of tables use a composite-key as the primary-key and I am not able to retrieve the populated row from...
I'm trying to use Circumflex ORM (as suggested on StackOverflow - here, here and here) to connect to a local (embedded) Apache Derby database over JDBC from a Scala project (built with simple build tool). I've followed the instructions carefully, but am having some interesting problems.
Here's the driver and URL components of the cx.pro...
About to kill myself here.
This is failing:
List<String> names = new ArrayList<String>();
names.add("sold");
Query query = em.createQuery("FROM PropField propField WHERE propField.name IN (?)");
query.setParameter(1, names);
List<PropField> fields = query.getResultList();
And so is this:
List<String> names = new ArrayList<String>();...
I have a need for allowing business rules to be defined in a commercial, shipping product with respect to data authorization rules. The rules need to be customizable in the field, and the customizations need to survive updates of the application. The system is C#/ASP.NET.
I've considered using a DSL for this, but it seemed like a lot ...
Ok so this is probably a trivial question but I'm having trouble visualizing and understanding the differences and when to use each. I'm also a little unclear as to how concepts like unidirectional and bidirectional mappings affect the one-to-many/many-to-many relationships. I'm using Hibernate right now so any explanation that's ORM rel...
I'm working on a project that normally uses SQL Server 2005; however, there is an additional requirement that the system needs to be able to run without a database - using data from serialized objects saved to disk.
Are there any .Net ORM frameworks can do this natively, or can fairly easily be modified to do this?
...
ZF has a very nice feature which is called findManyToManyRowset which returns you directly a collection of objects from a MN connection. The whole purpose of MN is to get the information from the other table, not from the connection table.
We have this schema:
- users
- id
- name
- groups
- id
- name
- user_has_groups
- use...
I'm having a problem with my ORMLite package ( http://ormlite.sourceforge.net/ ). When I generate the schema for a table, I thought it would be a good practice to escape all entity names. This would protect some Java class or field name from being a SQL reserved word:
CREATE TABLE "footable" ("stuff" VARCHAR(255))
I'm now adding "ra...
My problem is that I have an object A which contains a list of B Objects
@Entity
class A {
@OneToMany(cascade={CascadeType.MERGE})
List<B> list;
}
When I make a "merge" of an object A and then call "flush" inside a stateless EJB method
em.merge(a); //a is of class A
em.flush(); //doesn't flush "list"
it actually doesn't wor...
I'm writing some integration tests for a Spring/Hibernate app I'm working on, and I would like to to test things with as close to real conditions as possible, which includes using Hibernate's second level cache and committing transactions.
I was wondering if there was an efficient way to ask Hibernate to delete everything from the datab...
I have a question regarding n-layer architecture. I thought long and hard before asking this question as there's a lot of similar questions here already... however, after literally a day and a half looking at it and reading these other answers I'm still unsure. The variety of seemingly similar terminology and different approaches has me ...
I'm using symfony 1.4 with doctrine as my ORM, I need to do one of two thing to get it working, and I don't know how to do it. If anyone can help me please do :-P
the id fields should not be bigint, just int or
When I define my table as follows:
Table:
columns:
id:
type: integer
autoincrement: true
primary: true
make th...
I'm blocked on this GORM inheritance problem I have and id appreciate some fresh eyes to have a look over this problem. (Im using Grails 1.3.2)
I have a base abstract class...
abstract class MaintenanceSchedule {
static belongsTo = [ maintenanceTask:MaintenanceTask ]
}
and I want to extend it like so...
class OneOffSchedule exte...
I have this code:
db.query(sets, stores).select_from(orm.join(sets, stores,\
sets.store_scheme_id == stores.store_id)).filter(sets.id == id).one()
And I have the SQL debugging level at DEBUG, so it prints out the generated SQL query before it returns. The generated SQL works fine in phpmyadmin. SQLAlchemy, however, DOESN'T work fine a...
Can I somehow work with remote databases (if they can do it) with the Django ORM?
It is understood that the sitting has spelled out the local database. And periodically to make connection to various external databases and perform any sort of commands such as load dump.
...