Hi i am using Java 1.6 with hibernate and spring. I am having problems with hibernate models using inheritance mapping of type @Inheritance(strategy=InheritanceType.JOINED), or table per subclass.
Scenario:
we have 3 tables each mapped to a hibernate model
each table shares the same single column primary key
the java models extend eac...
I have a string property on an entity that I would like to mark as required. For example,
public class Product
{
public virtual string Name { get; set; }
}
In my mappings, I can declare Name as required (using Fluent NHibernate):
mapping.Map(x => x.Name).Required();
However, this only restricts the string from being null. If I ...
I have an one-to-one, bidirectional entity relationship with shared keys. When I attempt to save the owner of the association I get a "null id generated" exception against the owned side of the relationship. I am utilizing hibernate-entitymanager and using spring for transaction management.
Owning Entity
@Entity
@Table(name = "lead")
p...
Trying to create an object from an HQL query, but just can't figure out what i'm doing wrong.
Query:
String query = "SELECT product.code, SUM(product.price), COUNT(product.code)
from Product AS product
GROUP BY product.code"
(or should I use new MyCustomList(product.code, SUM(... , even though it's not mapped?)
Now I want to cast thi...
I am trying to add transaction support to an existing webapp via spring transactions.
i recently changed my session factory class from LocalSessionFactoryBean to AnnotationSessionFactoryBean.
now i get the following error when the webapp starts:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tx...
I am using grails, and I am getting the following when trying to create a new EducationType in my controller
2010-10-26 17:14:49,405 [http-8080-1] ERROR util.JDBCExceptionReporter - Violation of UNIQUE KEY constraint 'UQ__educat
ion_type__0519C6AF'. Cannot insert duplicate key in object 'dbo.education_type'.
2010-10-26 17:14:49,409 [ht...
What is the benefit of detached object? What value do they provide? Thanks.
...
We are going to provide an advanced search option on a system that will let users find events that matches a name (textual search), have on or more tags assigned to it and that will start before or after a given date. Should I consider using hibernate search or something similar? Or should I just generate some jpql queries to get that s...
I've come across some problems using Hibernate 3.4 on JBoss 5.1.
Hibernate 3.4 is a JPA 1.0 implementation so it should be fine to be used in JBoss 5.1. The thing is JBoss has its own version of Hibernate, which is located at /common/lib whereas I don't want to use the version provided by JBoss. What I did was that I removed the hibernat...
I just configured @PersistenceContext(type=PersistenceContextType.EXTENDED) on my DAO classes to get lazy loading working on the view layer (needed to get it not closing the session for this) but I am having issues with 1 level cache (I imagine).. Because the object is cached even with my second level cache settings off. After turned off...
I have criteria query that, when executed, results the following exception thrown:
java.lang.IllegalArgumentException: org.hibernate.QueryException: illegal syntax near collection: id [select generatedAlias0.permissions from temp.package.commons.user.Role as generatedAlias0 where generatedAlias0.id=2L]
at org.hibernate.ejb.AbstractEntit...
I have a bunch of classes annotated with hibernate annotations. I'm using Maven, Hibernate and Spring. How can I generated the DB schema using hibernate3-maven-plugin's hbm2ddl?
...
I am new to Spring and the bean concept, so sorry if asking the obviously.
I have set up a Java project and used the Hibernate framework to make my connections to the DB (using hibernate tool on eclipse, really recommended btw).
My basic setup was as follows:
some hibernate pojos (generated by Hibernate tools),
hibernate mapping files...
Hi,
I am using Hibernate with my Spring MVC project.
Lets say my model has 2 objects each linked to Oracle tables, respectively USERS (USERID, NAME) and USERMONEYDATA (CATEGORY, USERID, AMOUNT)
My users can add , edit and remove rows in USERMONEYDATA, that belongs to them of course.
Now, I want to have a view that aggregates those da...
Hi all, im in trouble with implemenetation of a service layer, i think i did not understand this concept very well.
In a DAO implementation i can write all CRUD logic for a specific technology and entity (for example hibernate and User table), and in a service layer we use a DAO for all data operation for the entity in DAO (like getUser...
Hi
I have an entity annotated with the following:
@Entity
@Table(uniqueConstraints={@UniqueConstraint(columnNames={"name"})})
public class Component extends Model {
...
}
Is it possible to make the UniqueConstraint case insensitive? We are using PostgreSQL.
Thanks in advance
Rich
...
Generaly all I want is to create simple Wiki like flex app using BlazeDS and Hibernate (like one provided in Enverse (part of Hibernate ) presentation Data Versioning and Envers Adam Warski JBoss / Red Hat)... Jeneraly I get how to do most of stuff to create service model but this is what I do not get:
public class WikiListener implemen...
Hi!
I'm relatively new to hibernate technology, and want to create an application with that. I have read that is not recomanded to use "hibernate's creation tabels" option (hibernate.hbm2ddl.auto) for a production environment. Does that mean that i need to create first tables and after that my POJOs classes or this recomandations is onl...
I have following problem:
I'm trying to implement Spring in existing ear application (using Jboss as App Server and Hibernate as ORM).
The ear application consists of war(basically few simple servlets), har(hibernate archive which has only the data model-as classes and the corresponding hibernate mapping files - as xmls), sar(only one pa...
I have 2 classes which have many to many relationship. I take the 'Question' and 'Tag' as an example to make the case more understandable.
For each question, you have several tags. The same as for tag.
What I would like to do is to get all questions (and their corresponding tags) if the question contain a tag says "hibernate".
I c...