table 2 « Table « JPA Q&A





2. temp tables    forum.hibernate.org

4. programmatically changing destination table    forum.hibernate.org

Hi! Due to various historical reasons, we have a database schema where table names change every quarter. For example, a person table changes from Person_2006q1 to Person_2006q2 and so on. My question is, what is the best way to insert/update into these tables without having to regenerate our mappings every quarter? Also, we may need to write to a different quarter ...

5. Can we create The table with hibernate    forum.hibernate.org

Hi try the following in your hibernate configurations file: create create : Creates your schema every time your run HB update : Creates your schema every time your run HB etc.... I Think there is a way to only generate the ddl but you have to check Chapter 20 of the hibernate documentation for that. Good Luck

6. too many tables    forum.hibernate.org

I am relatively new to hibernate, I have too many tables in the Database by using table per subclass approach. Is there any way to reduce these tables by adapting a combination of different strategies.My hbm file looks like this. Thanks in advance

7. Table statistics    forum.hibernate.org

Hi everyone, Basically I have a Java object where none of the object properties corresponds to a table field. Each object property is the result of a complex query. There are about 15 complex queries that need to be done to create the object and my concern is in efficiency. Will it take too long to create the object? Does my ...

8. Many-to-many with different FKs to same table    forum.hibernate.org

Newbie Joined: Sat Mar 25, 2006 12:43 pm Posts: 6 Location: Santa Fe, NM Hi, I'm having a problem getting some many-to-many associations working correctly. I have the following tables (relevant columns included only): POD pod_rec_nbr (unique) pod_basin (= PK1) pod_nbr (= PK2) pod_suffix (= PK3) PRIORITY prior_rec_nbr (= PK) SUMMARY basin (= PK1) nbr (= PK2) suffix (= PK3) And ...

9. Calculate Progress between many tables    forum.hibernate.org

Hello, I have an application which is connected to a database. This database has three tables (for this scenario). The tables are ContactDetails, BillingDetails and ShippingDetails, where ContactDetails has a ForeignKey Relation to BillingDetails and ShippingDetails. Thus I have created three POJO objects for each one of these tables, and then I save and load them according to how specified in ...





10. Simple question/answer. How add extra element to xref table.    forum.hibernate.org

Newbie Joined: Thu Jul 27, 2006 1:14 pm Posts: 3 Working from the hibernate tutorial: http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html I would like to move from the canned example of: Code: _____________ __________________ | | ...

11. Hibernate rel tables.    forum.hibernate.org

Hi, I am new to hibernate. I have just noticed that if I make 1:M rel unidirectional or bidirectional, hibernate uses different table mapping stradegies. Why I don't know? If the 1:M rel is bidirectional, a foreign key is employed on the 1 side. This is standard O / R mapping. However if, the same rel is made unidirectional, so you ...

12. How to use Many to One for a Master Table?    forum.hibernate.org

Newbie Joined: Wed Aug 30, 2006 5:21 am Posts: 1 Hi All! I am using Hibernate springs and Struts to build my application! I have two Master tables-"Technology" and "Skills". Associate with each technology there are many skills, so as to make it one to many! I need to take data from these two tables and populate a drop down menu- ...

13. Creating tables    forum.hibernate.org

Being new to hibernate, and having the chance to start a new project with the latest hibernate, I'd like to start using a good pattern. I am using annotations on entity classes. I'd like to programatically create the table that match an annotated class. I saw SchemaExport but this appears to accept an xml file as input. Can I convert the ...

14. Import /export after table strucure change    forum.hibernate.org

Hi, We have been using hibernate to access oracle. Since our report queries used too many joins we denormalized the table design and merged some of the table. POJO classes were not changed, only the underlying mapping files are changed. We changed some enitty to component and added more fields fields in some table by denormalizing them. Since our POJO class ...

15. I can not reterive any table with hibernate tools, help me!    forum.hibernate.org

oracle.jdbc.driver.OracleDriver mvpdev2x jdbc:oracle:thin:@localhost:1521:ramon ...

16. PropertyAccessException when manually altering a table    forum.hibernate.org

hi, I've created a table using the hbm2ddl.auto-property. For now the data in that table is not important (still testing) but let's assume it is. I've altered the table by manually adding a column (alter table CLUB add ranking int(11) ) and ofcourse also added this property to the mapping file and the POJO. However, when I try to load anything ...





17. table copy    forum.hibernate.org

You are talking about the Object that represents Table B needs a reference to the Object that references Table A? That is a many-to-one relationship. If you have a one-to-many from A to B, then one of the relationships needs to have "inverse" which means it is not used in cascades. Anyways, search for examples of these, there are many. Chris ...

18. Implementors of an interface that have different tables    forum.hibernate.org

Hello Nlif and others, Same problem here... I'm implementing an e-commerce site and i want the basket to be able to hold a variety of objects from totally unrelated classes. Therefore i defined an interface `Basketable' and a basket contains a Set of Basketable objects. Basketable declares certain functions (such as getPrice, getDescription), but contains no member variables. For this reason, ...

19. Table Creation Related    forum.hibernate.org

20. Table Creation Related    forum.hibernate.org

21. Issue with a custom bridge table    forum.hibernate.org

Hi folks, I've seen on this tutorial:http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html#tutorial-associations how to use a bridge table in hibernate mapping. S it looks like that: Code: ...

22. Prefilling table upon its creation?    forum.hibernate.org

Hello! Here's my problem - I have a table, that I would like to prefill with some fixed data via some hibernate mapping file or something. So, whenever the table does not exist or is empty, it is created and prefilled with some data. The only thing I can think of that might something to do with my problem, is ...

23. Can Auto Create Table if the table is missing    forum.hibernate.org

24. Table Creation Options    forum.hibernate.org

Hello, some questions on the mapping when creating tables with hibernate: - Is it possible to tell hibernate to create indeces on some other columns than the id-column? - Is it possible to tell hibernate how to name foreignkeys in a database (for example to.payment instead of CC1173284250120) - Is it possible to tell hibernate to create some comments on the ...

25. debugging table creation    forum.hibernate.org

Hibernate version:3.2.1 Name and version of the database you are using:MySQL 5 i have two hibernate.map in two differenet mapping files. these two definitinos are almost the same, but just one creates the table defined in the mapping file, the other one doesnot. The objects referenced in the map do not have a reference back (one object just has simple properties, ...

26. Newbie Question: Automatic creation of tables / colums ?    forum.hibernate.org

Hello all, I just wondering about that Hibernate is complaining that the table, I specified in the .hbm.xml file is not present in my schema. Should it not create automatigally? Whats about colums? When I add to my bean a new property and I update the .hbm.xml file should hibernate not update the db table to add/delete a new column? It ...

27. hibernate table manipulation :(    forum.hibernate.org

28. Hibernate Table Creation    forum.hibernate.org

Hi, This is the code for it. Configuration config = new Configuration().configure(); SchemaExport sch = new SchemaExport(config); sch.create(true, true); SessionFactory sessionFactory = config.buildSessionFactory(); It drops and creates new tables everytime you run it. sch.create(true, true); This setting shows you the generated SQL as well as DDL is immediately executed in the datadase Though you can change the settings as you like. ...

29. how to make a table readonly    forum.hibernate.org

30. Just modifying junction table    forum.hibernate.org

I have two tables as follows: Code: ...

31. CREATE TABLE with SQLQuery in Hibernate 3.2.4    forum.hibernate.org

Thanks so much but that's not exactly what I'm looking for. The problem is that my application will perform dynamic tables creation. For example, my application receives information on what I want this new table to look like, number of fields or columns, datatypes for each of them, their names and all elements in a table creation. Then, I must have ...

32. is it possible to create tables on the fly?    forum.hibernate.org

In my application, I need to store data whose schema I don't know in advance. Ideally, once I find out the schema, I would call 'CREATE TABLE', add a mapping, and store/retrieve my objects as beans. It looks like, however, that mappings can not be added at runtime. Am I completely out of luck? Are there workarounds people use? Thanks a ...

33. Possiblities to create tables    forum.hibernate.org

I'd like to know if there is a possiblity to create only one table at runtime if it doesn't already exist; independent from the used DB. Actually I'm using a MySQL DB and I know, it's possible to create a table per JDBC: Code: Session session = sessionFactory.getCurrentSession(); session.beginTransaction(); ...

34. Many To Many Cross table question    forum.hibernate.org

I have this simple scenario, but I can't get my head around it: Table Group (id, description) Table SubGroup (id, description) Table GroupSubGroup (id, group_id, subgroup_id) So, Groups can have several SubGroups, and SubGroups can have several Groups. The users need to add and delete both ways. Mapping looks like this: Code:

35. internazionalization table    forum.hibernate.org

Hi all I have a product application that manage internazionalization with db tables. Actually for each tables exists another similar tables that maps all the language labels. I wonder if exists a easy way (using interceptor for example) to directly map a query on the internazionalization tables. I mean exists a way to intercept all query and generally all transaction and ...

36. How to use @hibernate.set table ?    forum.hibernate.org

Dear Team, I looked Hibernate manual and FAQ, tried Google this for long time, but still have abscure picture about this. 1. What does @hibernate.set table="t" mean? For example in T.java, * @hibernate.set table = "T" cascade = "all" lazy = "true" * @hibernate.collection-key column = "tId" * @hibernate.collection-one-to-many class = "com.my.model.T2" Does all update apply to table "T" or "T2" ...

37. Hibernate 2 FKs to the same table    forum.hibernate.org

Hello, i have following problem: I have one table MODULE. And i have one table CONSUMER. Now i want to connect MODULE with CONSUMER, because evry MODUL has one CONSUMER. But the difficult part is, that i need another connection from MODULE to CONSUMER. Both are 1 to 1, but they are different. Consumer has only one PK wich the Module ...

38. How to build an associatio between a table and relationtable    forum.hibernate.org

I have a relation table named Table_Role_Process (trp) which set Table_Role (tr) and Table_Process (tp) in relationship to each other. trp has a column trp.Role_ID and a trp.Process_ID (and some more). I want to display the Table_Role columns in a JSP but some columns should be fedded by Table_Role_Process (and all columns may be editable). How do I have to code ...

39. table listener    forum.hibernate.org

Hey, I have a problem, I have only read access to table and I need to know when an entry is insert, delete or updated. The table is manged by a different jdbc session which is not on my server and I can't user triggers on the table. I have been looking at Interceptors and Listeners, but it seems they only ...

40. Best way to implement a label table?    forum.hibernate.org

41. Large - wide tables    forum.hibernate.org

I have several tables in my database that contain lots of columns. For example, I have a table that contains 50 columns and let's say 1000 records. If I have a need to query this table for all of its records but require just two of the columns, is Hibernate the best approach to getting this data? This is assuming that ...

42. Hibernate is attempting to alter tables!?!    forum.hibernate.org

I have an entity that uses an @EmbeddedId to identify the composite primary keys. in that entity I have a @ManyToOne relationship to another entity that also has an @EmbeddedId to hold the composite primary keys. If I allow hibernate to alter the tables in my derby database it will successfully run two queries against my two entity tables and populate ...

43. Is Restrictions.or usable across tables    forum.hibernate.org

Say I have a domain model class Item { Long id; String name; User seller; } class User { Long id; String name; } and database tables ITEM (ID, NAME, SELLER_ID) USER (ID, NAME) Say I want to query for all items which have "apple" in it or which are owned by "King": HQL: from Item i, User u where i.name ...

44. Descriminator Against another table?    forum.hibernate.org

I am trying to map a complicated schema which has a table that contains several different subtypes but the descriminator on that table is an id into a second table that names the subtype. This schema was made to be very generic so we can have one instance of the schema for each customer and allow each customer's schema to have ...

45. Recommended way to create a multi-item multi-table summary    forum.hibernate.org

I often need to display a read-only list of sumary data for multiple entries on the screen to allow a user to pick one item to edit e.g. show summary data for all customers or all orders. In the past I have modelled these as persistent objects and allowed Hibernate to fetch all rows eagerly normally using inner joins. However this ...

46. Can these two table be OR Mappped by Hibernate?    forum.hibernate.org

Newbie Joined: Thu Jul 24, 2008 6:48 pm Posts: 2 There are two table. One is dictionary table--DICT. Another is user definition table--USERS. The association of the two tables can be described by the follwoing SQL: select a.username, a.password, a.role_code, b.name role_name from USERS a, DICT b where a.role_code=b.no and b.type='role_code' Can the following tow tables be OR mapped by Hibernate? ...

47. How to check if a table exists?    forum.hibernate.org

48. replicate not copying junction tables    forum.hibernate.org

i have two objects a and b. both have a many-to-many relationship and therefore they are connected in a junction table. when i try to copy the state of a and b from one database to another, i use session.replicate(a) and session.replicate(b). both objects are saved in the database, but the junction table is empty. any solutions?

49. Hibernate executing table scan on Sybase table    forum.hibernate.org

Hi , I need help with Hibernate communication with Sybase. I'm trying to run a query on Sybase table, which has index on a non unique column. Instead of running the index scan, hibernate is trying to execute the table scan. As it is a large table, it is not able to perform the table scan and throwing exceptions. Is there ...

50. Populate a table on startup    forum.hibernate.org

Hi, I would like to insert initial data (by using a simpe insert statement) right after the create table operation. I want to do that by using an XML file and no in the application layer. Actually the sql-insert does not help me due to the fact that it's just essential for performance issues. Any suggestions? Thanks Dyahav

51. how to use hibernate with three more tables    forum.hibernate.org

I needed to query for results based on data several levels deep in the relationship hierarchy. This is the code I used: Code: session.CreateCriteria(typeof(AppSection)) .CreateCriteria("AppRoleSectionAccess") ...

52. DiscriminatorColumn two layers deep using SINGLE_TABLE    forum.hibernate.org

I mis-typed in one of the class descriptions: "extends SpeciesType " is just supposed to be "extends Species". However - to clarify on a simpler note: Table : columns : ... core_discriminator ... sub_discriminator core_discriminator.....sub_discriminator .........A................................' ' .........B................................' ' .........C................................CA .........C................................CB .........C................................CC Consider that the discriminator columns are class names to keep things simple, I cannot figure out how to achieve ...

53. audit tracking and many-to-many tables    forum.hibernate.org

... ...

54. How to let Hibernate AUTO-CREATE Table if it not exists?    forum.hibernate.org

When I save in my Hibernate-based java app an object then it is successfully stored in the existing Table in a MySQL Database. However when I do a DROP TABLE and re-run the same program again then I got an error. How can I let Hibernate create AUTOMATICALLY create all necessary TABLEs if they NOT exist? Peter

56. Create table with Hibernate    forum.hibernate.org

Hello, I'm developing a web application using Java (NetBeans 6.0) and Hibernate 3.3, in this application the user can create or delete new tables; for this operation I can't use the mapping files and java classes to define and manipulate the structure of those tables (they didn't exists yet when I write the code of the program) so I would use ...

57. Help trying to create tables on the fly    forum.hibernate.org

I am working on a project for a client that indexes large files. One of the goals of the rewrite was to also do it in a way that any database could easily be used with it. So it was decided that hibernate would be used. We got it all working with hibernate using hbm.xml mapping. But just recently two new ...

58. Table creation in Hibernate    forum.hibernate.org

Hello I'm working with Hibernate 3.2.4, and I'm working with some database issues that I have have implemented using it. The question is if I can perform tables creation with Hibernate so: "CREATE TABLE 'table-name' ('id-name' 'id-type', 'field1-name' "field1-type", ...)". Off course using SQLQuery. Is this possible to do with Hibernate? How?

59. Linking of two independent tables using hibernate    forum.hibernate.org

I have two independent tables TRANSACTION and LOCK in my database. All the unprocessed records(processed='N') are selected by the query for processing from TRANSACTION table.. Before processing, the record entry is stored in LOCK table. The main reason for storing the entry in LOCK table is to avoid processing of more than one transaction record with the same account and cusip ...

60. How can I use AD-HOC tables with Hibernate    forum.hibernate.org

I have a system where i have a number of well defined tables that are mapped to hibernate normally through their interfaces. All of this works just fine. However, what I want to do is add the capability for users to define new tables with a web based interface. The user would connect to the ad-hoc data part of the web ...

61. Hibernate and Oracles nested tables    forum.hibernate.org

62. Daily Tables    forum.hibernate.org

Hi All, I've used Hibernate before in a number of small projects, but this one has come up and has me a little stumped as to how I might implement it. I'm building a system to receive, process and store SNMP traps for a period of up to 1 year. Due to the number being received (> 1,000,000 per day), we ...

63. Is it possible to mark a table to read only?    forum.hibernate.org

64. stop auto aliase for tables    forum.hibernate.org

65. Checking for existance of tables    forum.hibernate.org