hibernate

Is this possible in Hibernate 3.2

Think 2 entities OneToOne mapped. Person and Car. A Person can have a Car. We have a Person object loaded from database. I want to change Person's Car. The problem is I don't have a loaded Car object to use. Instead I only have Car's ID. Using this Car Id , is it possible to set Person's Car to that wanted Car (which we have it's id), ...

Hibernate Encoding

Hi. Im trying to insert data with japanese characters to an oracle database. The things is what is saved in the database are bunch of inverted question marks. HOw do I resolve this ...

InvalidMappingException Hibernate mapping file...anybody can you give resolution

My mapping file is <class name="com.myapp.companypojo.Company" table="COMPANY"> <property column="COMPANYNAME" length="25" name="companyName" not-null="false" type="java.lang.String"/> <property column="LOCATION" length="25" name="location" not-null="false" type="java.lang.String"/> <property column="NOOFEMP...

Hibernate or iBatis or something else?

In my project i need to switch between databases during runtime. I tried to use Hibernate, but stuck in a place, where i need to map object with table in database. The problem is, that i have several tables with prefix: documents2001, documents2002 ... As i understood, i can't map class with table during runtime. I tried using iBatis, bu...

Mapping db-imported countries to address entity with JPA

I ran some DDL script to setup a complete country table in my database. The country table's primary key column contains the corresponding ISO code for every country. In my JPA project I have a User entity having an embedded Address entity and this Address entity has a reference to a Country. The relationship between User and Address se...

How to get Hibernate configuration properties?

I`m using hibernate with jpa, and it is configured with persistence.xml Is it possible to get hibernate connection properties from web application? Thanks. ...

Lightweight Java database with Maven plugin for starting/stopping?

For unit tests, demonstrations and Hibernate tasks I would like to use a small and simple Java database like Derby / Java DB or HSQLDB, which can be called from within Maven. So far I have not found a Maven plugin which can download and launch Java DB (which is my favorite at the moment) or something similar. ...

How can I use hibernate with MS Access?

I want to use hibernate with MS Access. Which dialect should I use and can you give me a sample hibernate configuration file with MS Access? ...

Hibernate map collection with constant key

Hi, I'm trying to map a collection (of type map) using a foreign key and a fixed value as the key/mapping arguments. I have several tables of product types and a language table which holds stuff like product names and so on. Now let's say we have an Accessory table which holds (obviously) accessories, then the name of an accesory is s...

what are annotations in hibernate?

briefly, can someone tell me what an annotation is in hiberate? (java) is it a way to quickly map entities to tables? ...

Hibernate: OutOfMemoryError persisting Blob when printing log message

I have a Hibernate Entity: @Entity class Foo { //... @Lob public byte[] getBytes() { return bytes; } //.... } My VM is configured with a maximum heap size of 512 MB. When I try to persist an object which has a 75 MB large object, I get an OutOfMemoryError. The names of the methods in the stack trace (StringBuilder,...

Combination of field as unique where one is a one-to-may unidirectional with HIbernate/JPA annotations

hello i'm not sure whether the title depicts the my situation very well.I'm developing a user and contact managment system with hibernate. i have an UserAccount pojo, contact pojo and phone object.i limited it to 3 since since those are in concern.UserAccount has a bidirectional with contact, and both have unidirectional with phone pojo....

Disabling locking for non-critical Grails/GORM domain classes

Assume the following code in a Grails controller: def action = { ClassName o = ClassName.findByFoo(params.foo) if (o) { o.counter += 1 } } By default Grails uses optimistic locking via the version column added by default to all GORM database tables. However, if a sufficiently large number of multiple concurrent requests are ...

What happens if hibernate_sequences table is accidentally reset?

Hi, I am using hibernate with ID annotations: @Id @Column(name = "ID", nullable = false) @GeneratedValue(strategy = GenerationType.TABLE) For some reason the hibernate_sequences table, which is managed by hibernate, has been reset. ie. Newly inserted entities have IDs (numbers) less than older entities. Is this normal? Won't there be ...

many-to-many (self referencing problem) vs double one-to-many

Hello! I'm facing some of the problem some of you already talked about and sorry to bring this out again. It's just like I still don't get certain aspect of hibernate. I'm using maven2, hibernate 3.2.5 ga, spring 2.6.5 SEC01, hsqldb 1.8.0.10, netbeans 6.7.1. I'm bulding a user and contat management and I've managed to get a working "m...

Persisting to SQL Server 2008 using stored procedures, JPA and Hibernate

We are implementing a web page to maintain an organisational structure. The structure is stored in SQL Server 2008 and uses the new HierarchyID data type. Because we have had problems getting JPA and Hibernate to play with this new data type we have decided to use views and stored procedures to abstract away this data type. So we want to...

How do you deal with linktables when using Domain Driven Design and nHibernate?

If you have the tables Groups, Users, Channels and between each two a linktable, how do you organize that in Domain Driven Design and nHibernate? Does a Group have a UserCollection and a ChannelCollection, a User a GroupCollection and ChannelCollection and a Channel a GroupCollection and UserCollection? And if you want to add a Group to...

Which java web framework to choose for client side and server side validation?

We are currently searching for a java framework , that made validation easily on server side and both client side,Spring,Hibernate,Play are the framework choices that we are searching,we are using annotation based development and this framework will determine our javascript choice too.Which is better framework (architecturally) at valida...

HQL with a collection in the WHERE clause

Hello good people! I've been trying for the this whole a query who is officially giving me nightmares. The system is a user and contact management. So I have UserAccount, Contact and Phone. UserAccount has a bidirectional one-to-many relationship with Contact and an unidirectional one on phone all mapped by a Set: //UserAccount ma...

Dependency Injection failing - hibernate with struts2 using the full-hibernate-plugin

Hi, i'm trying to use hibernate in a struts2 example using the struts2 full hibernate plugin (http://code.google.com/p/full-hibernate-plugin-for-struts2). I've placed all the Jars in my lib folder: antlr-2.7.6.jar commons-collections-3.1.jar commons-fileupload-1.2.1.jar commons-io-1.3.2.jar commons-lang-2.3.jar commons-logging-1.0.4.ja...