data « Database « JPA Q&A





1. How to transfer data from one database to another with Hibernate?    stackoverflow.com

I have an application A with a domain-model which is mapped to a database using Hibernate. I have another application B that uses exactly the same domain-model-classes as A and adds ...

2. Issue in Adding data into database using hibernate    stackoverflow.com

I am getting the following exception while adding data into database: org.hibernate.HibernateException: The database returned no natively generated identity value I am using the following code:

Session session = HibernateUtil.getSession();
Transaction tx = session.beginTransaction();

session.save(user);
logger.info("Successfully data ...

3. application specific seed data population    stackoverflow.com

Env: JBoss, (h2, MySQl, postgres), JPA, Hibernate 3.3.x

@Id
@GeneratedValue(strategy = IDENTITY)
private Integer key;
  1. Currently our primary keys are created using the above annotation. We expect to support a large number of users (~million ...

4. Wicket - user data internationalization    stackoverflow.com

I'm writing an application using Wicket/Hibernate and I need to support many languages. How to make good internationalization of user data in a PostgreSQL database? Thanks for any help/suggestions.

5. InvalidStateException while trying to enter data into DB    stackoverflow.com

I have a method that return the entity manager for particular DB.Now when i use the method for the first time to get entity manager everything works fine.I can save data ...

6. How do I keep user specific data separate in my database?    stackoverflow.com

I'm in the planning phase of designing an app that will involve users registering with my website and storing data. I've decided on using Spring and Hibernate but I have a ...

7. Can I use hibernate for data centric applications?    stackoverflow.com

I wag going through a hibernate tutorial, where they say that hibernate is not suitable for data centric application. I am very much impressed by the 'object oriented structure' ...

8. Best practice for storing global data in J2EE App using Hibernate    stackoverflow.com

I'm looking for the best solution to store Java EE application's global data using Hibernate. It will consist of key value pairs. Example:

projectStarted = "10-11-11"
developerNumber = 3
teamLeader = "John"
As you see, ...

9. Problem with retriveing data from my database using JPA    stackoverflow.com

I'am tring to retrieve from my database (using JPA) for a given list of items name their id, my function wich called by my addFunction return just the id of the last ...





10. Problem retrieving data from the database using hibernate    coderanch.com

Hi all I using hibernate3 as the ORM and mysql as the database.I am saving data from one form into the database and retrieving this data on a different page in a table. The first time i save ,the data gets stored to the database and it gets retrieved on the other page. But when i do it the second time ...

11. Is Hibernate a good choice for 'dumping' data from another database?    coderanch.com

Hi, The project I'm on is looking at 're-architecting' a portion of our code, and we're looking at several options - Hibernate is one of them - but none of us know that much about it right now Basically, we have 'our' database, but every so often we 'dump' data from other databases to update the information in ours. We start ...

12. Data retrivel from DB using Hibernate    coderanch.com

14. JPA: Dynamic login data for database    coderanch.com

16. db model vs application data model (using JPA)    dbforums.com

I'm not sure if this forum is considered appropriate for the following matter. Let me know if it isn't. I'm working on an application which gets its data partially form a db (Derby in combination with JPA) and partially from manual input. Lets call the application a scenario editor. The application has to produce an XML file which is used for ...





17. Hibenrate wipes out data from database    forum.hibernate.org

I am facing a strange scenario where the Java hibernate wipes out / deletes the previously stored data in the database table when you restart the program. In the same running session, it works fine. The thing is why it should wipe out even when primary key is in place? I am committing the data too in class files. ...

18. Howto move data from db1 to db2    forum.hibernate.org

Hi! The situation: We have developed a web application with a somehow complex data model (around 30 tables with several references) based on hibernate as the ORM. This application is used by our customer on several servers. Let's say they have an application server a1 with a database db1 and another application server a2 with its own database db2. The application ...

19. Hibernate config for trigger provided data?    forum.hibernate.org

I am evaluating whether or not to use Hibernate for a new app that will re-use an existing Oracle DB schema that is used by many other applications. In this schema, nearly all of the tables have more than one column where default values are provided by triggers in situations where no value has been provided for that column (e.g. a ...

20. Data fatching problem with Postgres    forum.hibernate.org

Hi All, I am new with Hibernate and Postgres DB. I want to fetch the data from the table, which is a table of Postgres. But every time I got the blank data, while there are some data in the table. When I tried this code with MySQL database then its working fine. Is there any other different configuration with Postgresdb? ...

21. Hibernate not retreiving data from database views    forum.hibernate.org

Hello all, I am trying to query a view for retreiving some data with the following queries select new BoComponentsVw(id) from BoComponentsVw boComponentView where boComponentView.id.endItem in('261746','71018AA010') or from BoComponentsVw boComponentView where boComponentView.id.endItem in('261746','71018AA010') both are same. these are the mapping files and entity objects. ...

22. Need to compare encrypted data stored in DB    forum.hibernate.org

Hi: We are storing encrypted data in the tables. The encryption and decryption code is written in Java and is done before and after saving/retrieving data from the DB. I am looking for a way to be able to query the database with a like statement. For example, if userName column in the table is storing encrypted data, is there a ...

23. Hibernate SQLQuery not retrieving data from database    forum.hibernate.org

I have a large legacy system that uses hibernate in a somewhat unconventional way. Basically, one thread hangs on to a connection taken from the hibernate session and performs batch jdbc inserts into a table. (I won't get into why this happens but just that it was due to performance considerations). Another thread uses hibernate's SQLQuery object to retrieve data from ...

24. hibernate doesn't stores data in DB    forum.hibernate.org

I did the following program: Quote: class Test{ public static void main(String[] args){ CD cd = new CD("Piero", "Morgana", new Date(), 12.99); try{ Configuration cfg = new Configuration().addClass(CD.class); SessionFactory sessionFactory = cfg.buildSessionFactory(); Session session = sessionFactory.openSession(); session.save(cd); session.flush(); session.close(); } catch (Exception e){} } } the error is this: Quote: log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environm ent). log4j:WARN ...

25. Anyone know of a good DB data transfer tool    forum.hibernate.org

I want to move the data in one DB schema on a particular RDBMS into another, identical, schema on a different RDBMS (to prove that our Hibernate-based App works fine when you stick a real DB underneath it). Does anyone know of any good tools out there for this (beside SQL Server DTS')? Preferrable Java-based and opensource? Cheers, Shorn.

26. Problem when gathering data from a database    forum.hibernate.org

Hi! I'm having some trouble with hibernate. Take a look: Code: Collection ocorrencias = session.list("from OcorrenciaVO as o where o.statusControle="+ codStatus + " order by o.id"); Iterator i = ocorrencias.iterator(); while(i.hasNext()) { Ocorrencia o = (Ocorrencia)i.next(); String fileName = o.getImagePath(); if(fileName == null) { ...

27. Help atomically moving data between two databases    forum.hibernate.org

Hello, I use Hibernate 2.1 and my application has two databases, one local (MS Access) and a remote (SAP DB). The databases have the same tables and from time to time I move data from the local to the remote one (data is deleted from the local database in the process). For the sake of simplicity let's assume I need to ...

28. Synchronization DB x Memory data    forum.hibernate.org

Hey, I want to know how I can to do the synchronization of the data in the DB with the data in memory. My problem is, when I rollback the session or the transaction, the DB is not altered of course, but the data in memory is not rolled back. The class of the object is mapped to the Hibernate correctly. ...

29. Not submitted data in a combo box to the database    forum.hibernate.org

Beginner Joined: Wed Mar 24, 2004 8:43 am Posts: 42 hi i have jsp form, it includes two combo boxes. the values of the combo boxes are filled using sql query( From another tables) It is working successfully,but the problem is, when i going to submit the above form , the error occurs. i used hibernate 2.1/mysql errors 14:50:56,543 WARN JDBCExceptionReporter:38 ...

30. exporting data from file to db    forum.hibernate.org

hi, all I use xstream for serializing the objects that I load from database (mapped by hibernate) to a xml file. It works fine but when I try to load that object to db , I got some db exceptions like unique key violation or first insert the object b... That is because of the many-to-one association. (lets say A and ...

31. problem writing data to the database    forum.hibernate.org

Hello, I am new to hibernate so maybe it is a stupid question. I have made a simple application: public static void main ( String[] args )throws HibernateException { Configuration cfg = new Configuration(); cfg.addClass(ch2.Message.class); SessionFactory sf = cfg.buildSessionFactory(); Session session = sf.openSession(); Transaction tx = null; try{ tx = session.beginTransaction(); Message message = new Message("Hello World"); Message nMes = new ...

32. losing data with hsqldb    forum.hibernate.org

Hi, I'm using latest Hibernate in my webapp framework and I've configured it to use HsqlDB. When I start my webapplication using Tomcat, I see the last contents of my database as well as this CONNECT USER sa PASSWORD appended to the end of the file: INSERT INTO DOWNLOAD_INFO VALUES('42de6054fffef7de01001e1383730108','Test','Test@test.com','Test',NULL,0,false,1100016223090,'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705)') INSERT ...

33. Data is not written to database    forum.hibernate.org

Session sess = factory.openSession(); Transaction tx; try { tx = sess.beginTransaction(); //do some work ... tx.commit(); } catch (Exception e) { if (tx!=null) tx.rollback(); throw e; } finally { ...

34. One-to-one, Many-to-one and db data inconsistency    forum.hibernate.org

I thought maybe i can make it one-to-one and that could work but when I took a look at documetation I saw that there are two ways to map one-to-one. In one case , the associated link between them is the pk in the parent and the child and the second way to map one-to-one is by mapping it many-to-one :) ...

35. Migrating data from one database vendor to a diff vendor    forum.hibernate.org

Hibernate version: 2.16 Mapping documents: N/A We are in the process of migrating some data from a legacy DB2 database on an AS400 over to oracle 10g. We are using hibernate to pull the data out from DB2 with a hibernate session specific to that environment, and then using BeanUtils we compose the objects for the Oracle environment and the use ...

36. Reloading a full DB without lossing data access    forum.hibernate.org

Hi all, I have a small problem I would like to solve. I am pretty sure I am not the only one having this problem. Hibernate will be connected to a quite big database (15Gigs) all day long in read only access. At midnight, I have to reload the database again with updated Data (let say : Account, Client, Product, Basket, ...

37. Migrating data from a staging DB part II    forum.hibernate.org

Hi, I posted a question on Friday regarding data migration and have since found a similar unanswered post from the beginning of September. I've got fairly close to a solution but it's pretty hairy and if there's a better way to achieve what I'm trying to do, I'd love to hear some suggestions. Basically all that I want to do is ...

38. cann't get data from database    forum.hibernate.org

public List getUsers() { try { return getHibernateTemplate().find( "from LoginUser"); } catch (Exception ex) { System.out.println(ex.getMessage()); logger.error(ex); ...

39. data is not added to database    forum.hibernate.org

40. Problem in getting data from database    forum.hibernate.org

Hi, i am lakshmi and am new to hibernate concepts. i am working on Hibernate version 3.0. i am unable retreive data properly from the database. while i try to retreive data all the rows in my table get deleted from the database. also for any transaction made the code is deleting the relationships built accross tables in the database.but there ...

41. Writing same data to multiple databases    forum.hibernate.org

Hi, We have a number of databases deployed throughout our organization. While all of these databases are different, they all contain a few tables that have the same data. What I would like to do is have a master interface that would allow me to update entries in all of these common tables in all of my databases. What would be ...

42. Objects and Data not getting created/posted to HSQLDB    forum.hibernate.org

Everything seems OK with 'create table', 'insert', 'drop table' etc. statements and commit, when I execute hibernate tutorials/samples. But nothing is written to the DB. No exceptions occur. The DB is created with lck, log, script, and properties file. Script file just has got "CREATE SCHEMA PUBLIC AUTHORIZATION DBA CREATE USER SA PASSWORD "" GRANT DBA TO SA SET WRITE_DELAY 20". ...

43. Data Truncation while reading DB2 Character dataype    forum.hibernate.org

Hi, I am facing strange problem of data truncation when I load data from DB2 Character(X) field type. I am trying to get data using session.createSQLQuery() and get the object[][] array. I am facing data truncation problems when I try to get data from object array. Pleaes review the following example to understand the problem better. SQLQuery query = session.createSQLQuery(strSQL); ArrayList ...

44. hibernate not getting the latest data from DB    forum.hibernate.org

Hi, I have a problem in retrieving the latest data in the database using hibernate. In my application, I log in to an account and modify a record in the DB using session.update(instance) [with committed at the end]. I can see in the DB table that it was properly updated. However, when I try to view my update with the same ...

45. how to synchronize database data within multi-applications?    forum.hibernate.org

1st level cache is in the Session not the SessionFactory. As such, keep your units of work small (limit the life of the session); implement version checking in both applications and be careful using 2nd level cache. While mentioned in the context of Hibernate, these concerns are valid anytime multiple applications are updating a single db. Good luck, Curtis ...

46. Trouble getting fresh data from DB    forum.hibernate.org

Hello, I am using Hibernate 3. I have a generic type called "Content", and a subtype called "Item". Item is mapped to a database row. Everything starts up fine and I can pull data from the database fine. I have a seperate system that updates the Database rows. Once this is done, it sends a JMS message to a listener I ...

47. Get data from web service instead of DB?    forum.hibernate.org

48. How to display data from database    forum.hibernate.org

Hi Can someone help please? I have a connection to my Posrgresql database. How do i display the data that is contained in my list? the part in bold does not work and give the error: log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Hibernate: select name from NAMES Exception in thread "main" ...

49. How to display data from database    forum.hibernate.org

Hi Can someone help please? I have a connection to my Posrgresql database. How do i display the data that is contained in my list? the part in bold does not work and give the error: log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Hibernate: select name from NAMES Exception in thread "main" ...

50. Can Hibernate automatically dump data into DB?    forum.hibernate.org

steve wrote: Sure, include a file named import.sql at the root of your classpath. SchemaExport will pick up this file and "import" its contents after it has exported the schema. The format of this file is a new-line-delimited series of SQL commands... That is to say , if i place import.sql at the root of my classpth with .hbm.xml files together ...

52. using data from existing db with hibernate    forum.hibernate.org

Hello, I've an existing db(firebird) with lots of data and I've to implement a new application which has to use the legacy data. All tables has ids with type integer and the legacy models have ids of type integer and will change a little bit. (adding new fields). I must bind (hook up)this db with hibernate and use the legacy data ...

53. taking data from one db to other    forum.hibernate.org

54. (Hibernate with JPA) data conversion between DB and java    forum.hibernate.org

Table "SUBSCRIPTION": --------------------------------- | ID | IS_MONTHLY --------------------------------- | 1 | 'YES' | 2 | 'NO' | 3 ...

55. Data not written into DB    forum.hibernate.org

org.hibernate.ejb.HibernatePersistence my.class ...

56. best practice for migrating data between databases    forum.hibernate.org

Hi folks, this is what happened so far: I have an old version of an app running and a new version which uses a different data model. All table's ids are identity columns (using sybase 15.0). To import the old data into the new tables, I wrote an importing tool that creates two sessionFactory objects to connect to both databases. It ...

57. How to export data into CSV file after getting data from DB.    forum.hibernate.org

How about using Apache POI write the data into excel sheets? I do that in my application. You can use Jasper reports also. A simple solution is to use display tag http://displaytag.sourceforge.net/11/ to display the data on page and from there export it to excel. Lot of options...you have to plan... And finally Hibernate helps to map data from database records ...

58. Problem with retrieving data from database    forum.hibernate.org

Hi, i was using Hibernate version 3.2.4.ga and have mapped such a class. @Embedabble public class Period { private Date startDate; private Date endDate; ..... } then i use it .... @Embedded private Period period; ... This worked fine with version 3.2.4.ga . However, because of bug in this version with MySQL and MS SQL Server had to switch the version ...

59. syncronize DB data    forum.hibernate.org

Hi, I am trying to syncronize data from one database to another using Hibernate. Hibernate version: hibernate-3.2 Name of the database I am using: MS SQL Server 2005 My tables use generated identifiers as primary keys. I use the name of an object as its natural id. For example, Database 1 has table customer with one row having values cust_id=100, cust_name="ABC" ...

60. multiple JPA applications, same database, stale data    forum.hibernate.org

I have just finished porting a simple Hibernate application to JPA. The same code is used by multiple distributed web applications, each application having the ability to modify and read the *same* database. In the original application we used ehcache to reload objects on a regular basis (every few minutes). What is the best way to achieve this using Hibernate JPA? ...

61. stale data - multiple apps same db    forum.hibernate.org

Newbie Joined: Wed May 13, 2009 6:52 am Posts: 1 I have two webapps A & B running on tomcat. A is saving some data for B to read. B is having problem retrieving commited data saved by A. But if B is restarted, it get the data properly. Any help is appreciated... Here is the code from A (save): Code: ...

62. retrieving fixed length character data using sqlquery in Hib    forum.hibernate.org

How to retrieve fixed length character data (for example char(5) ) from database using hibernate SQLQuery? example: Object obj=session.createSQLQuery("select col1 from table1 where col2='12345'").uniqueObject(); Note: datatype of column 'col1' is char(5) In result iam getting only the first character, the rest of the characters are gone.......need help in retrieving the whole data

63. Data transfer between different Database    forum.hibernate.org

Newbie Joined: Sun Mar 01, 2009 11:11 pm Posts: 9 Hi, I need to copy some data from a remote DB and insert into a target DB. I have a DB Link created in my target DB for the remote DB Now I want to run a native sql and type caste the result into my target DB Domain object and ...