Schema « Schema « JPA Q&A





1. Dealing with schema upgrades while using Hibernate    stackoverflow.com

I'm using Hibernate as the ORM for my application. I would like to know if there is a good solution to dealing with schema upgrades in my application when these upgrades ...

2. hibernate general problem    stackoverflow.com

Hi: 1)what is the difference between schema and a catalog? That's to say in the cfg.xml,what is the meaning of hibernate.default_schema and hibernate.default_catalog? 2)how to handle the struture-same table? I have ten tables in the ...

3. JPA2/Hibernate - Creating a schema on the fly (ie without pre-create the schema manually)?    stackoverflow.com

I use JPA 2 with Hibernate Entity Manager 3.6.4. Once I have marked my entities with various annotations (@Entity, @MappedSuperClass etc), I put in my persistence.xml file the default schema to ...

4. turn off schema in hibernate    coderanch.com

5. How to keep Hibernate from exporting a schema if one already exists?    coderanch.com

I sometimes run DbUnit tests of my Spring application's DAOs using an in-memory HSQL database, and other times using an Oracle database. It's necessary to allow Hibernate to build the schema for the HSQL database (since one doesn't already exist), but when I run the DbUnit tests against the Oracle database I do not want the schema to be modified. Currently ...

6. hibernate with two schemas    coderanch.com

hi all, I have a problem with hiberante query.i have two schemas in my database A,B and i have two hibernate queries with me. i have to fire the first query on a table of schema A. Based on the result that i got ,i have to fire the second query on a table of schema B. Is it necessary to ...

7. Hibernate Made Easy Q - gen schema    coderanch.com

8. Connecting to two schemas using hibernate    coderanch.com

Hi, Could you please brief on the changes needs to be done. In the dataaccessContext.xml file we have dfined a data source which points to a single database. The Session factory and the transaction manager are mappedd to this data source. How can I define a new datasource and switch the mapping dynamically. oracle.jdbc.driver.OracleDriver

9. hibernate:problem with schema    coderanch.com

Hi, I have next problem with Hibernate. I am not succeed in generating primary key column in table. My table "Setting" with primary key "id" in schema "test" (Derby DB). In Setting.hbm.cfg ... ...





10. Hibernate check if schema exists    coderanch.com

Hi, Does anyone know how to check if a schema exists in hibernate? I have the name of the default schema set in a properties file, but if that schema does not exist, our installation page hangs. I'd like to check if that schema exists, and if not, tell the installer to modify his or her properties file. Thanks, Skip

11. newbie hibernate question for an existing system schema change    coderanch.com

HELP: We've added 4 new columns to an Oracle database. I've updated all of the references to the table I can find in the existing Java code, annotations and xml files. However, the hibernate generated sql code ignores these columns when a new record is added and only updates the pre-existing columns. What do I need to do to get hibernate ...

12. Framework for data warehouse snowflake schema - JPA?    coderanch.com

I have a DB with operational data built with JPA that works just fine. Hooray for JPA! Now I'm building a data warehouse with historical data. It's designed according to the "snowflake schema", with gazillions of fact records and a few "slowly changing dimension" records. It seems that this can't easily be built using JPA. Or...? Professor Google appears clueless. Getting ...

13. [beginner] Java -> Schema    forum.hibernate.org

hi, I know how to generate entity beans, daos etc from *existing* database using Jboss Tools for Eclipse, but i can't get how to from annotated beans and existing hibernate.cfg.xml (jdbc connection, mapping class=... etc) generate schema for *new* database :( How to do that in eclipse ??? Code:

14. Problem with creating schema    forum.hibernate.org

Hi guys, I'm a newbie. There is something goes wrong in my hibernate configuration, I think. Simply the database isn't created. When I make a query, hibernate tell me that the relative table doesn't exist Code: 12:43:10,828 ERROR JDBCExceptionReporter:101 - Table 'geoip.country' doesn't exist at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494) ...

15. Hibernate not looking at correct schema?    forum.hibernate.org

16. Schema Management    forum.hibernate.org

I am pretty new to Hibernate and I am working on a project where I would like to be manage my schema changes from within my code to allow for doing things like populating default values, etc. My application is a JSF 2.0 based web application that I am going to distribute via a war file. What I would like, is ...





17. changes to the schema while hibernate is running    forum.hibernate.org

Hi all, I'm working on a high usage system which maps a few "read only" tables and views. At various points in time I need to replace the data in these tables with a newer version by connecting to the database externally. We are using postgres 8.3+ and hibernate 3.2.6. The external "update" process will be connecting to the db via ...

18. Storing data in mulitple schema    forum.hibernate.org

19. Schema Selection at Runtime    forum.hibernate.org

All, This has got to be a simple matter but for some reason I'm not getting it. Is there a way in hibernate to set the schema dynamically at runtime? I have multiple users say 2000. Over time new users are added and others are deleted. Each user uses the same table set. I would like to do something like userA.table1, ...

20. Help about designing multi-schema joins    forum.hibernate.org

Hi, We are developing a system, which is a set of modules, each module has their schema (domain tables set) and their business java component. All modules need some information from the others. The interaction in some cases is using webservices, but in another cases it's needed in data layer (multi-schema joins). Example of modules are: 1. People central DB 2. ...

21. Runtime change in d schema    forum.hibernate.org

22. hibernate schema desing issue    forum.hibernate.org

I need to link a row in a table with another row in the same table. can you tell me if this is achievable? is it possible to have a mapping table that shows that records that are linked for example record1 is linked to record2 etc. Example: I have a parent table called "student_records" which has "student_record_id" column as primary ...

23. schema creation    forum.hibernate.org

24. How to disable The Default Schema    forum.hibernate.org

25. Hibernate 4 multi tenancy separate schema code example    forum.hibernate.org

Hi I want to build code that uses multi tenancy using separate schema for each tenant. Can someone please post some code example as to how this is done? How do you map the classes to each tenant? How do you switch from one tenant to another? Thank you for your help, Tomer

26. Multy Tenancy with MultiTenancyStrategy.SCHEMA    forum.hibernate.org

Configuration cfg = new Configuration(); cfg.getProperties().put(Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA); cfg.addAnnotatedClass(Produto.class); factory = (SessionFactoryImpl) cfg ...

27. Hibernate Schema    forum.hibernate.org

Author Message David Morris Post subject: Hibernate Schema Posted: Fri Sep 19, 2003 8:05 pm I am working on a tool to generate Hibernate mappings and needed a schema (of the xsd variety) so I created one. So far it is working against my mapping files. Here it is if anyone is interested:

28. Best way to build extensibility into hibernate schema    forum.hibernate.org

Here's the scenario: I have an open source library called Informa which uses Hibernate for it's persistence layer. (It's an RSS library but that doesn't matter.) The users of my library (apps that call Informa, call them client apps) have additional information that needs to be persisted, much of it associated with existing Informa/Hibernate objects, some not. Here are the choices ...

29. mutiple schemas in hibernate    forum.hibernate.org

Newbie Joined: Mon Nov 17, 2003 10:53 am Posts: 15 hi, i would like to create a modell that reads and writes to multiple schemas in mysql. the clou on it is that i have to classes Foo and Bar that reside in different schemas (in mysql terms databases); where Foo has a reference on Bar first the java code Code: ...

30. Very Simple Schema Fails (Very Rarely)    forum.hibernate.org

Hi there, I've been using Hibernate with SQL Server 8 for some time now, and have seen very odd behavior from an extremely simple schema. Normally, saving and loading this object via Hibernate (using version 2.1) works just fine, but every once in a blue moon, I get a foreign key constraint. The mapping looks like this: Code: ...

31. select @ runtime a specific schema on a user basis    forum.hibernate.org

Hi all, I would appreciate your PoV on the following issue. We are about to start developing a web application for a large outsourcing company. The application will be used by users belonging to different companies. Each company has a dedicated schema on the database. The table structure is identical on each schema (so we have the same data model replicated ...

32. Can't create specific schema    forum.hibernate.org

What i want to get is to this... Code: Task <> (Composite) 1 --------- n TaskAttribute 1 --------- 1 Attribute where Task has a map of TaskAttribute instances and every TaskAttribute instance has a reference to one only Attribute. The attribute is an entity, so if I delete the TaskAttribute the Attribute is not deleted, otherwise TaskAtribute instances are Task composite, ...

33. Schema and Data Upgrade    forum.hibernate.org

I'm currently evaluating Hibernate and couldn't find info about the following. I wonder whether Hibernate's DB-Schema tools allow alteration of the data in the DB tables, in addition to the schema update. In other words, does Hibernate offer any help with the update of table data between releases of a product (e.g. deletion of a column, move of an entire column ...

34. different schema problem    forum.hibernate.org

35. Set schema    forum.hibernate.org

36. Schema Isolation through Hibernate connection props ?    forum.hibernate.org

Hi, This is a question thats architecture / database related. What is the best way to use / configure hibernate to allow it to use a schema per user or in other words restrict a schema per user login. Basically I have a DB [tables = accounting, employees and reports], but I have 100 clients, but I don't want 100 separate ...

37. Hibernate + Postgres (schema isolation)    forum.hibernate.org

38. Using several schemas    forum.hibernate.org

net.sf.hibernate.dialect.DB2400Dialect xx ...

39. hibernate.default_schema doesn't change my tablespace    forum.hibernate.org

When using Hibernate with DB2, I cannot get the tables to be created in the tablespace specified in the default schema. It creates the default schema correctly, but then uses the next available tablespace for creation which is not what I want. Does anyone know where I would specifiy the tablespace? I specify the defaults in: hibernate.default_schema and also in my ...

40. FKs and schemas : aargh!    forum.hibernate.org

Hibernate version: 2.1.6 DBMS: PostgreSQL (or any DBMS with schemas (i.e., namespaces)) Has anyone run into this situation before and solved the problem? Basically, I want to have N schemas that each contain the same tables (and dynamically choose one schema at runtime to use via "unqualified names", e.g., select * from foobar ... will resolve to A.foobar, B.foobar, ...). So ...

41. FKs and schemas : aargh!    forum.hibernate.org

Hibernate version: 2.1.6 DBMS: PostgreSQL (or any DBMS with schemas (i.e., namespaces)) Has anyone run into this situation before and solved the problem? Basically, I want to have N schemas that each contain the same tables (and dynamically choose one schema at runtime to use via "unqualified names", e.g., select * from foobar ... will resolve to A.foobar, B.foobar, ...). So ...

42. using configured schema instead of default?    forum.hibernate.org

43. schema evolution    forum.hibernate.org

Hibernate version: 2.1 This is not a bug or a defect, just a query. I am managing my database using hibernate and since it is still in development stages, there are frequent schema changes (additons, deletions, merges of columns, changing uniqueness properties of columns etc.) I would like some guidance as to what 's the best way to update your DB ...

44. Dynamicaly change schema    forum.hibernate.org

I would like to use Hibernate on a project but I have some constraints an I don't know if they can be handeled. Th project has to use 26+1 Oracle schemas. All users must connect on one schema (the technical one) and each user will execute his CRUD operation on only one other schema according to his security profile. Does Hibernate ...

45. Schema Generatiaon    forum.hibernate.org

Hi All, We just started a project which will use Hibernate 3.0 for persistence. Currently we are using the annotations to create the schema using hbm2ddl.auto property. I understand that this is NOT meant for production. In our organization, we need to provide the DDL for each and every table separately that include schema, table space indexes etc. In that case, ...

46. Tricky Schema    forum.hibernate.org

Thought an example might help... I have table Building with columns id, name, and location_type. The location_type column contains the location's table name. Currently I am querying the Building table and then creating another query using the value retrieved from the location_type column. I looked into the inheritence "Table per subclass, using a discriminator", but whe I try to create the ...

47. Re create schema    forum.hibernate.org

I am in a project where we have just started to use Hibernate 3.0 Question on schema update. Since we are still in the development stage, the database structure keeps changing. Whenever I recreate the database schema, even though the schema is properly updated, I loose all the previously existing data in the tables who's structure has not changed. Is there ...

49. Schema change at Runtime    forum.hibernate.org

Author Message bulloncito Post subject: Schema change at Runtime Posted: Mon Oct 24, 2005 7:13 pm Newbie Joined: Mon Oct 24, 2005 6:34 pm Posts: 14 Location: Guadalajara, Jalisco. Mxico. Hello, I've just downloaded a brand new jBoss 4.0.3 with the most recent Hibernate deployer for EJB3 and managed to deploy some EntityBeans using jBoss and Hibernate annotations, however ...

50. Easy way to change the schema?    forum.hibernate.org

Does the schema name have to be changed in each of the mapping files? Is there any option to use the JDBC connection url, e.g. naming=system;libraries=lib1,lib2 ?? This would make it easier since one could simply change the hibernate config file, as opposed to rerunning the gen tool, or manually changing each of the mapping files.

51. Setting Default Schema    forum.hibernate.org

I would like to use ONE session factory, but change the default schema used to automatically prefix tables on a PER-SESSION basis. Effectively, this would be like doing ALTER SESSION SET CURRENT_SCHEMA= on Oracle. The reason for this desired functionality is that the system I am using requires that the same database tables exist in multiple schemas of a single DB ...

53. Strategy for a highly normalized schema    forum.hibernate.org

Hi, I have a highly normalized schema like all type of objects are kept in one OBJECT table. all attrbutes of object are kept in one ATTRIBUTE table. all relation among objects are kept in one RELATION table. There are some supporting table for type lookup. I need to expose them into a web application, allow user to use form to ...

54. no schema possibility    forum.hibernate.org

55. How I can change Hibernate schema to runtime...    forum.hibernate.org

I'm not sure it's possible, but maybe you could do it by customizing your HibernateUtil class. I think you could do it by creating two SessionFactories, one for each schema. Then, in your code, you would be easily able to retrieve Sessions from one of the two schemas by querying the right SessionFactory.

56. centralize schema definition    forum.hibernate.org

57. centralize schema definition    forum.hibernate.org

58. Schema creation - Parent with child and bag dat    forum.hibernate.org

Author Message PaulRivers Post subject: Schema creation - Parent with child and bag dat Posted: Sat Nov 25, 2006 7:00 pm Newbie Joined: Sat Nov 25, 2006 2:56 pm Posts: 11 Update: Ooops I was having trouble even coming up with a workaround when I tripped across why - Code: ...

59. Postgres schema problem    forum.hibernate.org

Newbie Joined: Thu Dec 02, 2004 2:13 pm Posts: 10 Hello, I am having a problem with postgres and schemas. I am using annotations. The annotations for the class is: @Entity @Table(name= "iq2_product", schema = "public", uniqueConstraints = {}) I am getting an error complaining about schema "this_" does not exist. Caused by: org.postgresql.util.PSQLException: ERROR: schema "this_" does not exist My ...

60. Referencing the default schema from an sqlRestriction?    forum.hibernate.org

Hi - I need to add a restriction to a Criteria-style query like this: Restrictions.sqlRestriction( "{alias}.CUST_ID in ( select distinct SYNM_CUST_ID from CDIR.SYNM where SYNM_NAME like ? )" ); The issue is that I don't want to hard code the schema of the SYNM table (in this case, CDIR). Is there a way for an SQLRestriction to reference the default_schema from ...

61. Default schema and stored procedure    forum.hibernate.org

Hi, I am testing hibernate 3 - jboss 4.05 with stored procedure. I have declared a default schema inside hibernate-service.xml. It works fine with class mapping but it doesn't prefixed sql-query (call stored procedure). Have you got an idea ? It is possible to use default schema with sql-query and/or set schema dynamically ? Thanks, Regards JMP.

62. "schema" change in runtime    forum.hibernate.org

63. how to configure which schema to use?    forum.hibernate.org

I may have figured out my missing column error. it seems that hibernate is finding a table from another schema that has has the same name as another table it uses is there something i can put into the mapping config to let hibernate know what schema it should find this table in? 09:33:29,797 INFO [TableMetadata] table found: TSTLIVE.COUNTRY 09:33:29,797 INFO ...

64. Unsuccessful schema creation?!    forum.hibernate.org

Newbie Joined: Sat Oct 15, 2005 5:45 pm Posts: 18 I have the a class called 'Game', 'User' and 'Category', but the Game table is not being created. The debug from Hibernate is as follows... 22:32:09,667 DEBUG SchemaExport:303 - drop table if exists GAME_CATEGORY 22:32:09,699 DEBUG SchemaExport:303 - drop table if exists category 22:32:09,743 DEBUG SchemaExport:303 - drop table if exists ...

65. Unsuccessful schema creation?!    forum.hibernate.org

Newbie Joined: Sat Oct 15, 2005 5:45 pm Posts: 18 I have the a class called 'Game', 'User' and 'Category', but the Game table is not being created. The debug from Hibernate is as follows... 22:32:09,667 DEBUG SchemaExport:303 - drop table if exists GAME_CATEGORY 22:32:09,699 DEBUG SchemaExport:303 - drop table if exists category 22:32:09,743 DEBUG SchemaExport:303 - drop table if exists ...

66. Schema evolution best practices?    forum.hibernate.org

A more general question, for which I hope the answer is "read this document"; I just haven't found it yet. I'm getting ready for the first alpha of my product; from that point forward, I would like to keep my DB pretty much live, without wiping it and starting again. However, I expect to be modifying the product frequently -- indeed, ...

67. Specifying the schema programatically    forum.hibernate.org

Hi, I am using Oracle database and I have available multiple schemas with identical structure but that are used for different customers or for test purposes. I only have one user -and therefore a single default schema-. I manage to work with different schemas by modyfing my Hibernate mappings using the "schema" attribute of the "" elements in the "" file. ...

68. ClassValidator missing embedded members during schema create    forum.hibernate.org

During schema generation using AnnotationConfiguration, the ClassValidator is skipping members of embedded components with custom @ValidatorClass annotations. There is a fairly easy change to ClassValidator.createMemberValidator() to check if the memberAnnotation is a Embedded, then recursively add the embedded members to the memberValidators and memberGetters collections (of ClassValidator). Unfortunately, the BinderHelper.findPropertyByName method (3.2.1.ga) and the ClassValidator.findPropertyByName method (latest version) don't recursively find ...

69. Two Hibernate DBs with Same Schema, Copying from A to B    forum.hibernate.org

I have a general question about the best approach for copying data between two databases managed by Hibernate. I have as of yet have not found a set of best practices for his. We are using: * Eclipse RCP 3.3 * Java 1.5 * Hibernate 3 * HSQL 1.8 Basically, we are deploying a desktop application to our customers. We have ...

70. Is t here a way of changing schemas without loosing data?    forum.hibernate.org

I have been searching web, here, and other places. Since Hibernate is such a neat tool my gut tells me there has to be a way of changing schemas without loosing data. I am new to Java and learning techniques that I took for granted in the VB6 world. I have a class that starts with opening a connection for different ...

71. Having a seperate schema per user    forum.hibernate.org

Hi, I'm new to Hibernate and a somewhat novice at databases too. What I am doing is developing an application where I will have multiple users and for most tables not much sharing. To give some context, it is an application for the legal industry so I will have a table for a client(name, address, etc.), a table for case(case id, ...

72. TagSchema Schema with User Dimension    forum.hibernate.org

73. Can I tell hibernate to ignore alternate schemas?    forum.hibernate.org

I'm using JBOSS 4.2.2.GA and deploying my project in an ear file. I'm using a DB2 datasource defined in a deployed xml file. Right now, we're in development and have several slichtly-different schemas in the database. I can tell the datasource to use a default schema. but have not figured out how to tell hibernate to ONLY use the default schema, ...

74. Seeking resources on schema refactoring with hibernate.    forum.hibernate.org

Hi, I'm just getting started with Hibernate, and I'm looking for resources on how to safely do lightweight refactoring to a DB schema/data model. The application I wish to refactor has been written using hibernate from the ground up, so I feel confident that there's a mechanism to do this refactoring, but I haven't been able to find many resources on ...

75. Hibernate + Quartz: Handling different schemas    forum.hibernate.org

Hi, This is my first post here. I'm currently working on a project to create a scheduler using Quartz to schedule a number of jobs. We are using Hibernate for the back-end. However, most of the jobs don't share the same schema and they requires access to different schemas. I'm new to Hibernate and just wondering if there is a way ...