I have a parent class that contains a list of children. I have the parent and child mapped bidirectional with a has-many and an inverse on the parent with cascade.all turned on. If I modify an object in the child list, but no property on the parent, nHibernate does not save the child. If I modify a property on the parent everything saves...
I recently got a reply from a server company asking if we are using an ORM in our application which does all the work of sifting application side (like Rails) or if we write reams of SQL, embedded functions etc which would make the database server do the processing for you.
Can anyone explain what is meant by this. Our web application ...
I am learning JPA w/Hibernate using a Java SE 6 project. I'd simply like to be able to detect if the connection between Hibernate and my database (MS SQL Server) is open. For example, I'd like to be able to detect this, log it, and try reconnecting again in 60 seconds.
This is what I thought would work but isOpen() doesn't appear to be ...
This is probably a long shot.
In the .NET world, has anyone found an ORM (Commercial or Open) that has the flexibility of NHibernate to support domain driven design with good Linq support? Linq to sql is dead, Entity Framework doesnt yet support POCO's, lazy load or object first development very well, and none of the old stand bys such...
Why are assigned id’s frowned upon in the Nhibernate world? Is there a particular disadvantage to using it?
...
Hi,
I'd like NHibernate to fill a collection on my class from a custom query. My setup is somewhat like this:
Class A has a one-to-many relation to Class B. B has two many-to-one relationships to Class C, From and To.
In Class B, I want to be able to map a collection of C instances, based on the From and To relations. The collection s...
What is the name for the technique of using a set of foreign keys in a table where all but one are NULL for a given row?
In other words, each row needs a foreign key to one (and only one) of n different possible tables so you actually have all the necessary foreign keys but all but one are NULL.
(users of Django may recognize this as a...
Is it possible to store something like the following using only one table? Right now, what hibernate will do is create two tables, one for Families and one for people. I would like for the familymembers object to be serialized into the column in the database.
@Entity(name = "family")
class Family{
private final List<Person> famil...
I would like to do the following, all in a single atomic transaction:
Read an object through ActiveRecord
Save a new object through ActiveRecord
Update another table via NHibernate
Also, if by the time I finish the transaction, the value of the object I've read in step 1 has changed, I would like the transaction to fail.
I've never ...
Are there any good tutorials how to start weppapp with Spring 3, eclipse and hibernate?
...
How do you make a column (let's call it OrderID) an auto incremented primary key in the various .NET ORMs?
Linq To SQL
[Column(Name="OrderID", IsPrimaryKey=true, IsDbGenerated=true)]
Entity Framework
[EdmScalarProperty(EntityKeyProperty=true, IsNullable=false)] (Not possible to specify autoinc?)
NHibernate
[Id(Name = "OrderId"...
I have Country and State objects. I intend to have unidirectional many to one relationship from State to Country. I don't want to store any references to States in Country I have defined mapping as below. When I delete even one State object, all Countries are deleted!
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hib...
I already have hibernate mapping files and pojos created by Netbeans to which I've added named queries and extra methods.
Now I've added another table to the database and a foreign key column to an existing table.
It's not a big problem with just one table to add the mappings by hand but it gets tedious and error prone with more.
What...
Hi guys,
I try to develop JPA project on ibm RAD. And i can run it on Webpshere successfully,
but the problem is my machine is quite old. So deploying in JEE container isn't
reasonable.And i want to run it on JSE.But it gives following error:
94 test INFO [main] openjpa.Runtime - Starting OpenJPA 1.2.1-SNAPSHOT
235 test INFO [m...
We have your bog standard Java app under development, and a lot of the records we're creating (Hibernate entities in MySQL) have 'created' and 'modified' timestamps on them.
Now, me and one of the developers disagree - I believe that both of those fields should have a MySQL default of CURRENT_TIMESTAMP, and then the modified can be chan...
Hi.
We use NHibernate for ORM, and at the initialization phase of our program we need to load many instances of some class T from the DB.
In our application, the following code, which extracts all these instances, takes forever:
public IList<T> GetAllWithoutTransaction()
{
using (ISession session = GetSession())
{
ILis...
The reason why I ask this is because I need to know whether not using ORM for a social networking site makes any sense at all.
My argument why ORM does not fit into social networking sites are:
Social networking sites are not a product, thus you don't need to support multiple database. You know what database to use, and you most likel...
Anybody aware of a best practices or example project out there that uses ASP.NET MVC and LLBLGEN (selfservicing or adaptor)? Possibly something similar to S#arp Architecture.
I'm new to MVC and I'm constrained to using LLBLGEN.
...
I'm trying to map a @ManyToMany association using hibernate. But so far I only managed to have cascade on one of the foreign keys.
My source code goes like this:
@Entity
public class Airplane {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
@OnDelete(action=OnDeleteAction.CASCADE)
@ManyToMany(m...
Our software is a customized Human Resource Management System (HRMS) using ASP.NET with Oracle as the database and now we are actually moving to make it a product that supports multiple tenants with their own databases.
Our options:
Use NHibernate to support Multiple databases and use of OO. But we concern related to NHibernate learni...