0
votes
0answers
9 views

Get current object ID in Generic DAO. Hibernate

I want to delete all objects by their IDs in Hibernate Generic Dao implementation. For now I created method like this: @Override public void deleteByIds(Collection<Serializable> ids) { ...
0
votes
0answers
9 views

java.lang.ExceptionInInitializerError on hibernate with JSF

i am new on Hibernate and JSF and try a tutorial. I do the same things from the tutorial, but i get an error when i start my Project, that should save my data on the database with hibernate, and i use ...
1
vote
2answers
27 views

Hibernate, persisting ManyToMany

I'm trying to persist an addition to a list in an entity that have a many to many relationship with the other. My database is like this: CREATE TABLE book ( isbn VARCHAR(20) PRIMARY KEY NOT ...
2
votes
0answers
20 views

Fresh Hibernate 4 documentation?

Official Hibernate documentation contains a lot of deprecated features, like here http://docs.jboss.org/hibernate/orm/4.1/quickstart/en-US/html_single/#d5e57 protected void setUp() throws Exception ...
0
votes
1answer
26 views

What is Object relational mapping(ORM) levels in hibernate

I've came across this question a couple of times when searching for jobs, but, when developing, I never come across this terminology anywhere. I know they are 4 levels in it, but does it really matter ...
1
vote
1answer
41 views

Get object by ID in Hibernate

I noticed that our senior developer uses following code for retrieving entity by ID: @Override public Source get(Long id) { Session session = getSession(); if( session == null ) ...
0
votes
0answers
11 views

Hibernate OneToMany mapping null, ManyToOne not null

Relevant parts of the code: @Filters({ @Filter(name = "tenantFilter") }) @RooJavaBean @RooToString @RooSerializable @RooJpaActiveRecord(table = "group_user", schema = "public", finders = { ...
0
votes
0answers
6 views

How to use hibernate-search with JBoss datagrid?

I have this requirement to use JBoss Datagrid to stop some document and make it searchable. So, I'm thinking of using Hibernate-search which is part of JBoss already. But now I'm stuck. Here's a ...
-1
votes
1answer
18 views

MS SQL server + spring integration [on hold]

Can you suggest how to integrate spring mvc with ms sql server ? (Before it I used with mongodb, spring mvc + sprign-data-db) I am looking for best practice for integrate spring mvc and ms sql ...
2
votes
4answers
41 views

Can I add 'ON DELETE CASCADE' to tables managed by Hibernate?

I have some tables managed by Hibernate with various foreign key constraints. Cascade on delete is currently managed by Hibernate alone. For playing around with test data I often create and remove ...
0
votes
1answer
17 views

Error java.lang.ClassNotFoundException: org.springframework.orm.jpa.EntityManagerFactoryUtils only when guery didn't find any results

I'll post my code first. public boolean checkIfExists(String name, String surname) { Object m = null; entityManager.getTransaction().begin(); Query q = ...
0
votes
3answers
36 views

Querying a column that doesn't have a corresponding variable in the class

Assume I have a class class MyClass implements Serializable{ int x; int y; String z; } That represents a table that has x, y, z and another column called i. I ...
1
vote
4answers
39 views

Native sql query location

I have an Spring+Hibernate application. For some actions I need to use native sql. My question is where can I store sql queries. I don't want to hardcode them. I want to know existed approaches. I ...
1
vote
1answer
33 views

Is Hibernate batching updates

So this my maiden question so here it goes... The idea is I am doing a large number of update statements to a database table. In sql it would be a simple update table_name set col1 = 123 where col2 = ...
0
votes
1answer
36 views

Setting many to many relation from non owning side

I have 3 entities. viz A B C Enties A and B have one to one relation. Where as B and C has many to many relationship. @Entity @Access(AccessType.FIELD) class A{ @OneToOne(cascade=CascadeType.ALL) ...

15 30 50 per page