Tagged Questions
0
votes
0answers
26 views
why generationtype.sequence in mysql doesn't work?
i am developing an application using hibernate 4.1, zk 6.5 and mySql 9.3, I tried using generationtype.sequence in my code but unfortunately it returned an error, after doing some research on the ...
3
votes
1answer
64 views
could not initialize class com.mysql.jdbc.driver Caused by: java.security.AccessControlException: access denied
Am new to hibernate, I created project(Google web application project) with the help of eclips ,
This is my hibernate config file ..
...
0
votes
1answer
29 views
Hibernate JPA Cannot Create due to FK
When I try to create a new category in my application I am getting the below error which is complaining about a FK constraint. However the FK it is complaining about maps the Category Description to ...
0
votes
1answer
74 views
No foreign key constraints in database.!
My organization works on Spring MVC with Hibernate. We always specify foreign key constraints in mapping file, like for person and contactList in Person.hbm.xml
<set name="ContactList">
...
1
vote
0answers
91 views
How to add an int array Default Value for a FluentNHibernate mapping
Recently, I added a new column to my UserMap class, to add an int array
public class UserMap : ClassMap<User>
{
public UserMap()
{
Table("user");
LazyLoad();
...
0
votes
1answer
91 views
idBag Generator Class Cast Exception
I've been trying to get an idbag working in hibernate. I been trying it against a MySql DB and a HSQLDB and I have also tried a couple different versions of Hibernate. Hibernate 4 and Hibernate 3 ...
0
votes
0answers
134 views
Mapping a table with only foreign keys in hibernate
I am new to hibernate and i want to map a table having only foreign keys using xml file.
I have 3 tables
1.UserInfo(for user details with a primary key)
2.AuthorInfo(containing author details with a ...
0
votes
1answer
22 views
In hibernate how to set status for various table objects
I have two objects, Customer and Store. I would like a user (from a user table) to be able to specify a customer or store as "preferred". I would then be able to see a list of users who prefer ...
0
votes
1answer
56 views
In hibernate, wrong value used as parameter for fetching set
I have to hibernate entities and tables with a one to many relationship. One is a user and the other is a car object. I believe where the discrepancy is, is that I am attempting to join on field ...
1
vote
0answers
79 views
Hibernate mapping of an Enum which implements an interface (i.e. is a subclass)
I'm getting my feet wet with Hibernate, and I've run into a problem which I can't find any solution to.
I have an interface MyInterface and an enum implementing the interface:
class MyInterface {
...
0
votes
1answer
56 views
Setting the value of a column according to the count() of the referred rows in another table to my table in SQL and hibernate mapping
I have the following tables in my database. I want the column booked_items in the testuser table to contain the number of rows associated with the user in the testbooking table. It is surely can be ...
0
votes
0answers
112 views
Hibernate bi-directional mapping with foreign key indicates on different entities
I have several objects (entities), for example: book, video, music. They aren't connected to each other in any way (extend one superclass or something). They have some properties like title and so on. ...
0
votes
0answers
83 views
Hibernate Mapping when adding a single aggregate field to a very large table
I'm having some trouble figuring out the right way to do the following: I have a table containing many small entries (hourly weather data covering a year) and want to add a field to my POJO that I ...
1
vote
1answer
508 views
Hibernate configuration mysql
Hi I am trying to configure hibernate with mysql.
I'm using Maven with IntelliJ to get my dependencies.
My hibernate config file is
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE ...
0
votes
1answer
147 views
Hibernate parameters injection inside mapping, possible?
I'm using Hibernate in many projets. Since time I've developped my projects including a translation table that containts text values in every language for every other tables that need it.
Mapping ...
2
votes
0answers
89 views
Multiple data sources with the same type of entities but different database
I have the same data to be submitted into two different MySQL databases. As soon as it updates, inserts, deletes in one, it should immediately update, insert, delete in the other or else rollback ...
0
votes
0answers
185 views
data is not inserting in my db table [closed]
Please see my below(SubjectDetailsDao.java) code of addZoneToDb method. My debugger is nicely running upto ** session.getTransaction().commit();** code. but after that debugger stops,I do not know why ...
0
votes
1answer
84 views
Why do I get a Hibernate NonUniqueObject Exception?
I'm trying to figure out why I am getting this very hard to debug hibernate error and I have narrowed down the triggering behaviour to when I try to save a customer objects which will have a subset ...
0
votes
1answer
394 views
How to fix the deployment error in Glassfish?
I'm getting the following error when deploying the application in the Glassfish server,
"Error occurred during deployment: Exception while preparing the app :
java.lang.ClassNotFoundException: ...
0
votes
0answers
538 views
Issues with mapping a view with hibernate
Updated:
I removed the view from MySQL and modified the annotations of the entity (I modified the class name as well). This now works but I still do not see why I was not able to map hibernate to a ...
0
votes
1answer
321 views
Hibernate SQL DDL script error 150, unable to make foreign key constraints
I’m using hibernate/jpa annotations to auto create/execute DDL scripts.
All my tables are being created except one table “UserAccount” and the foreign key “contraints” on all tables.
When ...
0
votes
1answer
396 views
how do i filter data while fetching data from database using hibernate?
I have multiple tables with a lot of data in it. I'm only mentioning things pertinent to the question. For rendering data on the jsp, I only need selective data from different tables.
In reference ...
0
votes
1answer
382 views
Hibernate MappingException while using annotation @Inheritance with MySql
I'am using Hibernate framework 3.6.10.Final and MySql. I'am getting
Exception in thread "main" org.hibernate.MappingException: Cannot use identity column key generation with mapping for: ...
0
votes
1answer
308 views
Hibernate many-to-many mapping and query to go with it
I'm having some trouble getting the hang of HQL. I have an application where I have a bunch of competitors in one table. Then I have competitions, where I match up the competitors. Each competition ...
0
votes
1answer
208 views
Synchronizing hibernate's session after inserts
I have code that select all rows of a database and deletes them. It performs this process continuously. When there is no data in the database, it sleeps for 2 seconds then tries again. My problem is ...
1
vote
0answers
117 views
Hibernate include Stored proc in schema export
I've created a stored procedure in my MySQL database and I want a way to have hibernate include the proc when I run org.hibernate.tool.hbm2ddl.SchemaExport to dump my hibernate configuration into a ...
0
votes
2answers
532 views
Hibernate: Using collection of complex objects throws exceptions
I am looking into Hibernate and storing collections of complex types. But I run into exception.
I have the following persistent class:
public class Item {
private Long id;
private Set ...
0
votes
2answers
222 views
Mapping Hibernate to MySQL (BEGINNER)
Is there a way to map an Entity class (Address.java) to MySQL without using Hibernate Mapping (.hbm files)
What i need to do is to Create a table called 'Address' in the MySQL DB, and create Columns ...
0
votes
2answers
123 views
which solution is good practice hibernate save data in database?
I have two entities which are Student and Class entities.
Student and Class are many to one relationship. So student contains class attribute.
Now i want to save or create a student associate with ...
3
votes
1answer
1k views
from hibernate to mysql, default value mapping issue
hibernate xml mapping file does not support default value. So when i try to create a column with default value in mysql, then i run the hibernate save() method without setting the column value. the ...