Hello,
I just have the db schema, and want to get the corresponding java classes for them in hibernate, and I do not want the hbm xml file style, so want to get the java classes with annotation generated automatically, is there any tool for this job?
Thanks a lot.
...
How do I use mysql's compress() and uncompress() functions to compress text before I store it and uncompress it when I retrieve it using a mysql database with hibernate for ORM?
...
Hi, I know that this has been discussed lot of times. I just can't understand how this work or where my mistake is.
I think giving you a reduced example is the best way to show you what I'm trying to do and what assumptions I'm taking...
I have a Product class with a name. The name is a String property that is lazy.
My DAO:
public ab...
I have JRE 1.6 and am using the following hibernate.cfg.xml file. I am always getting "Cannot open connection" and "The port number 1433/DB is not valid."
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibern...
I'm working on an application that stores conferences with their start and end date. Up until now, I was developing in Belgium and my server is in France, so everything is in the same timezone, no problem. But today, I'm in San Francisco, my server is in France and I noticed I have a bug.
I'm setting dates from a Flex client (ActionScri...
I have two jar files with hibernate classes mapped. One jar file is perfectly working and for the next jar file it is not mapped. I get Unknown Entity exception. Persistence.xml is good but i dont know why this is happening. Any guess what mite be the issue???
...
hi,
is there any way, to restrict hibernate not to create connection of its own(what we define in hibernate.properties or hibernate.cfg.xml), instead i can create and pass the connection to hibernate for further processing.
The problem is that i need to set the ApplicationContext on the connection given that the i am using oracle connec...
hi,
i am currently working on one project. In my project there are many entity/POJO files. currently i am using simple hibernate.cfg.xml to add all the mapping files in to the configuration like :-
<mapping resource="xml/ClassRoom.hbm.xml"/>
<mapping resource="xml/Teacher.hbm.xml"/>
<mapping resource="xml/Student.hbm.xml"/>
i am havin...
I have a entities as:
BaseEntity --> Which contains user login info like createdBy, createdTime, EditedBy, editedTime
Employee --> which contains employee information like name, address, etc...
RegularEmployee --> which contains salary, bonus tht kind of fields
and
ContactEmployee --> which contains HourlyRate, contactPeriod etc....
...
I have been updating all my services to be transactional by using Grail's ability to rollback when a RuntimeException is thrown in the service. I have, in most cases, doing this:
def domain = new Domain(field: field)
if (!domain.save()) {
throw new RuntimeException()
}
Anyways, I wanted to verify that this indeed will rollback the ...
i have a class campaign that maintains a list of AdGroupInterfaces. im going to persist its implementation
@Entity
@Table(name = "campaigns")
public class Campaign implements Serializable,Comparable<Object>,CampaignInterface {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strateg...
I got similar domain model
1) User. Every user got many cities. @OneToMany(targetEntity=adv.domain.City.class...)
2) City. Every city got many districts @OneToMany(targetEntity=adv.domain.Distinct.class)
3) Distintc
My goal is to delete distinct when user press delete button in browser. After that controller get id of distinct and p...
Hello all,
I'm having trouble trying to persist an entity which ID is a generated value. This entity (A), at persistence time, has to persist in cascade another entity(B). The relationship within A and B is OneToMany, and the property related in B is part of a composite key.
I'm using Eclipse, JBOSS Runtime, JPA/Hibernate
Here is my c...
Hi!
I am using Hibernate. I am looking for a free text engine.
Before I investigate into it I need your experience.
I have in my applications user, role and object table. Where a user is connected to one or more roles, and a role is connected to one or more objects.
In my free text search, the user can reach only data that he is all...
Hi!
I have the following code:
Criteria crit = sess.createCriteria(Product.class);
ProjectionList proList = Projections.projectionList();
proList.add(Projections.property("name"));
proList.add(Projections.property("price"));
crit.setProjection(proList);
But I also have User.class and I would like the name to be restricted on U...
Hi,
is there a way to configure hibernate3-maven-plugin so that a sequence generator is detected for a primary-key? I'm using a bottom-up approach for hibernate configuration (which means letting hibernate-tools generate the hibernate configuration using a jdbc-connection for you via reverse-engineering on an existing database schema). ...
I have a Vote domain class from my grails application containing properties like article_id and note
I want to HQL query the Vote domain class in order to retrieve the 5 best rated articles having at least 10 votes.
I tried :
SELECT v.article_id, avg(v.note), count(*) FROM vote v where count(*) >= 10 group by v.article_id order by av...
My Java bean has a childCount property. This property is not mapped to a database column. Instead, it should be calculated by the database with a COUNT() function operating on the join of my Java bean and its children. It would be even better if this property could be calculated on demand / "lazily", but this is not mandatory.
In the wo...
I am using JDO or JPA on GAE plugin in Eclipse.
I am using smartgwt datasource, accepting an xsd.
I would like to be educated how to generate an XSD from my jdo/jpa entity, vice versa.
Is there a tool to do it?
While datanucleas does all its magic enhancing in the Eclipse background, would I be able to somehow operate in a mode that w...
Using Hibernate + annotations, I'm trying to do the following:
Two entities, Entity1 and Entity2.
Entity1 contains a simple generated value primary key.
Entity2 primary key is composed by a simple generated value + the id of entity one (with a many to one relationship)
Unfortunately, I can't make it work.
Here is an excerpt of the ...