xml « Map « JPA Q&A





1. How can I query a SQL 2005 XML field with NHibernate?    stackoverflow.com

My Microsoft SQL Server 2005 database contains a table that has an XML field that has some important metadata, and under normal SQL I could run the following query and get ...

2. How to map inner object using Hibernate/JPA without xml/annotation?    stackoverflow.com

We have an object, A, which contains another object, B. We have Hibernate calling a stored procedure to query the data and populate instances of A. We're using the ...

3. Why do we use hibernate annotation?    stackoverflow.com

Why is it important? what are advantage according to XML mapping? Can you explan these? thank you.

4. Hibernate - How to use an Enumeration as Map's Key    stackoverflow.com

My entity defines a field like

Map<String, String> props;
I've got this hibernate xml configuration
<map name="props" table="PROPS">  
    <key column="id"/>  
    <index column="name" ...

5. Where should I put NHibernate hibernate-mapping xml files?    stackoverflow.com

I have trying to install nhibernate according this tutorial, but it doesn't say where I should place Cat.hbm.xml file and how project should understand its part of project.

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping ...

6. Why are people continuing to use xml mapping files instead of annotations?    stackoverflow.com

I've observed the strange fact (based on the questions in the hibernate tag) that people are still actively using xml files instead of annotations to specify their ORM (Hibernate/JPA) mappings. There are ...

7. Can nhibernate be used without doing the XML mapping?    stackoverflow.com

I have a lot of classes and this is a lot of work to do the XML mappings.

8. Hibernate one to one mapping problem    stackoverflow.com

I'm trying one-to-one mapping in hibernate, The hbm files and the classes are as follows, Student.hbm.xml :

<hibernate-mapping>
    <class name="com.psl.student.Student" table="STUDENT">
        <meta attribute="class-description">This ...

9. XML mapping with typed criteria queries    stackoverflow.com

I'm using hibernate with xml mapping I'm trying to run some simple code without much success. I am confident that mapping and classes are correct as I am able to perform ...





10. Hibernate annotation or XML configuration    stackoverflow.com

I have started a new project with Hibernate. Is Hibernate annotation a better choice or is Hibernate XML mapping better? I have used Hibernate with XML configuration, but I have ...

11. re. export and update utility of Hibernate and mapping xml files    coderanch.com

Hi, I am new to Hibernate. I have been reading hibernate document online, but could not figure out exactly about few things : - About export utility for database schema. It requires mapping xml files. What does this utility do. I mean if it creates classes - for database tables? and about mapping xml file- if there any utility to generate ...

12. hibernate mapping xml    coderanch.com

Actually i have define a column of a table as primary key. and for that column in mapping file i have put generator "identity" But when I am going to insert data in that column it is giving exception "ID does not have default value" can anybody tell me why it is happening?

13. hibernate mapping xml issue.    coderanch.com

Hibernate is an object-relational mapping tool. Data without a primary key is not relational. The problem is that without an id to uniquely identify a row there is no way this data can partake in a relationship. So Hibernate cannot support it. What you should do is add a surrogate key to your table. If you can't do this, you can ...

14. Hibernate mapping using Oracle XML    coderanch.com

Before I begin with my problem let me explain my hibernate setup. Hope you will bare with me and not leave in the middle of the explanation . I have a primary table called Automobile, with a secondary table called AutomobileDetails. The AutomobileDetails contain some attributes to connect to Automobile, and a string value which is an XML. Some(not all) Automobiles ...

15. Stored Procedures + Hibernate + Xml mapping    coderanch.com

Hi ranches ! People I already search in a lot of google sites and do not found any solution that fits my problem. I have the following SP in SQL Server 2005 Express: CREATE PROCEDURE [BI].sp_produtividadeGeral @dataInicial datetime, @dataFinal datetime, @grupoProduto varchar(100), @codigoLoja varchar(10), @codigoPessoa varchar(100), @codigoProduto varchar(100) AS BEGIN Select sum(valor) as valor, descr_setor from bi.pessoa_produto where data_venda >= @dataInicial ...

16. Mapping two different DB types in hibernate xml.    forum.hibernate.org

Hi Everyone , I am using hibernate 3.2.1 for inserting data in oracle and postgres, my problem is ,i need to map a column whose datatype is different in both databases . say for EG : I have a string which i have to store as number in postgres and as varchar2 in oracle. One way i found is ,using UserType ...





17. Mapping XML Nodes - possible limitation? With simple example    forum.hibernate.org

Login Register FAQ Search View unanswered posts | View active topics Board index Hibernate & Java Persistence Hibernate Users All times are UTC - 5 hours [ DST ] Mapping XML Nodes - possible limitation? With simple example Page 1 of 1 [ 4 posts ] ...

18. File import and XML mapping    forum.hibernate.org

19. Any real JPA2 XML mapping examples?    forum.hibernate.org

Hi! I believe that a picture is worth a thousand words. Some aspects of the JPA2 XML mapping are not well-documented. An examples of that is how to separate the JPA XML metadata into different files. What XML element do we start with in the indivisual files? It would be nice if a Hibernate JPA2 XML mapping was provided as examples. ...

20. Status of XML mapping feature?    forum.hibernate.org

Hi, On a new project, we are thinking of using the XML mapping feature for working with persistent XML data. I saw in the documentation that this feature is still experimental. What is its status? Do you know when it is going to be officially released? Do you think there will still be changes in the API? Is it stable enough ...

21. annotations vs. xml mapping files....    forum.hibernate.org

Hey guys, I'm new to hibernate and I'm somehow confused about hot to use it. As far as I understood there exists two approaches for Hibernate implementation. one by using hibernate configuration file , mapping classes with their xmls (Netbeans has the auto generation system for all these stuff) and the second approach is done by using annotations and entity classes ...

22. persistence.xml - mapping-file and/or class    forum.hibernate.org

24. one to one XML mapping    forum.hibernate.org

Author Message OldFart Post subject: one to one XML mapping Posted: Tue Apr 19, 2011 3:47 am Beginner Joined: Mon Apr 18, 2011 10:01 am Posts: 20 Hello, I have a problem in mapping a one-to-one relationship between two objects. The first question is, ( I use Oracle 10g and Java 1.4 ) should I set my constraint in ...

25. mixing Annotations & XML mapping    forum.hibernate.org

Hello, I am very new to Hibernate, and still reading some ebook about it. I read about NamedQuery and I wonder whether we can mix programming w/ Annatations and XML Mapping in one application, ie. I want to do the ORM via Annotations and define NamedQuery via XML mapping. Further more if I define a same NamedQuery via Annotations and also ...

26. Hibernate xml mapping working with HQL but not with get    forum.hibernate.org

net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sqlserver://localhost:1433/MyDatabase sa password ...

27. How to get The DOM Tree for the Mapping XMLs    forum.hibernate.org

Hi, I want to retrieve the DOM tree from the mapping XMLs. Let's say, I have a class A and its corresponding mapping XML A.hbm.xml. What needs to be done to get the DOM tree out of this XML? I tried something like the following Configuration cfg = new Configuration(); for (int i = 0; i < classes.length; i++) { cfg ...

28. Foreign key in the mapping xml file    forum.hibernate.org

Hi guys, I have an object. This object holds reference to another object. I would like to set the foreign key of the containing object to any field of the contained object. How could be this done in the mapping xml file ? The problem is that when Hibernate sets the foreign key of the containig object to the primary key ...

29. XML Mapping    forum.hibernate.org

30. Erreur Parsing xml mapping file    forum.hibernate.org

15:20:27,983 INFO Environment:469 - Hibernate 2.1.6 15:20:28,025 INFO Environment:503 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.gjt.mm.mysql.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=bugs, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:mysql://localhost/bugs2, hibernate.show_sql=true, hibernate.connection.password=bugs, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1} 15:20:28,036 INFO Environment:528 - using java.io streams to persist binary types 15:20:28,038 INFO Environment:529 - using CGLIB reflection optimizer 15:20:28,081 INFO Configuration:350 ...

31. Hibernate to map object to xml and xml to db?    forum.hibernate.org

Does Hibernate map object to xml and xml to DB table? That use xml as an intermedia form between object and db instead of directly mapping. This may sound silly, but in the scenario where object data need to be cached at client location before pushed to the remote DB storage, xml can be the medium used in caching in local ...

32. XML Mapping    forum.hibernate.org

Hibernate version: hibernate 2 Mapping documents: @author ZAL META_GRUPPEN

33. Getting Metadata Out Of XML Mappings    forum.hibernate.org

34. One XML Mapping for 2 Databases?    forum.hibernate.org

Hi, I have search the forum for this topic but I havent found any data on it. I would like to know if there is a way to have have a "unique" Hibernate persistence layer on 2 different databases. The "2 databases" requirement is important because we are planning to integrate the hibernate 3.0 layer on legacy systems. Lets say you ...

35. xml mapping    forum.hibernate.org

Hi all, I'm having problems creating relationship mappings. Ok, I have 3 tables: Table1: t1_id:PK (primary key) and some other fields Table2: t2_id:PK (primary key) and some other fields Table3: t1_id:FK (foreign key) references Table1 t2_id:FK (foreign key) references Table2 ... and some fields relationship of Table1 to Table3 is one to many / many to one " " Table2 to ...

36. How does Hibernate read Class mapping XML?    forum.hibernate.org

37. Working without mapping xml files    forum.hibernate.org

38. play with xml mapping    forum.hibernate.org

Hello, Some time ago I try with version 2.x but next I was reading about JDO and EJB and now I back to hibernate and start with version 3.x. XML mapping is great idea. Just super ;] I have got some data backuped in xml, I thought it is great chance to play with xml mapping. I have 3 class: A ...

39. XML mapping and componet support    forum.hibernate.org

40. Easy Newbie XML Mapping Question: Inheritance    forum.hibernate.org

Hibernate 3.0.5 MySQL 4.1.13 Windows XP/SP2 How do define the XML mapping information for this relational table layout. I don't care if the foreign key or cascading properties don't come out right; I just want to get the basic hierarchy working correctly. Code: -- This defines the ID space shared by different derived table types. CREATE TABLE GenericObjects ( ...

41. Parent/Child XML mapping incorrect    forum.hibernate.org

My original problem was that when performing a save() on my child object, it kept trying to UPDATE instead of INSERT. So I thought the issue might be solved by placing parent/child parameters in my XML files. I'm now getting an error that my XML is mapped incorrectly. Any help? --------PARENT-----------

42. Xml mapping file    forum.hibernate.org

43. Hibernate-Parent/Child XML Stored Procedure Mapping    forum.hibernate.org

Hi, I have a question regarding Hibernate mapping configuration. I have tried on this for some time and thought to take opinions if someone has already come across a similar situation. Actually, I need to generate XML file with elements having sub-elements up to various levels. I tried to map two different tables and could generate sub-elements in resulting XML successfully. ...

44. XML parsing error reading mapping file    forum.hibernate.org

45. XML mapping    forum.hibernate.org

46. Restore database from XML with the XML mapping    forum.hibernate.org

Regular Joined: Thu Oct 13, 2005 4:19 am Posts: 98 I am using hibernate 3.1rc1. I am also using the xml mapping feature of hibernate (chapter 19 in the manual), which is considered experimental. I am trying to dump and restore my database with that feature, making it easier to restore testdata. When restoring the database, it throws a ClassCastException on ...

47. XML Include for mappings    forum.hibernate.org

48. XML mapping How do I apply localized formatting.    forum.hibernate.org

When using the XML mapping features in Hibernate 3.0, how would I get a Date from the database formatted as I wish in the XML output? This question also applies to number formatting. If there is a current solution, does it work both for getting the data from the DB and when updating the DB? Thanks johan

49. XML import - Mapping Exception: Unknown Entity    forum.hibernate.org

Newbie Joined: Tue Nov 29, 2005 2:43 am Posts: 9 I am using hibernate version 3.0.5. I am trying to export/import data from and to hibernate objects. I have been successfully managed to export the data from hibernate object using DOM4J. However, when I try to import the same XML using dom4jsession it generates an error. Following is the call stack: ...

50. How to create a mapping for xml object with relational datab    forum.hibernate.org

Dear Members of Hibernate, I am using Oracle 9i database. I hava an xml file which contains several nested nodes and all the nodes contain valid data. These data will be stored in the database. Please advise me how to create a mapping between the xml object and the relational database tables and columns. I will only create the mapping and ...

51. Error parsing XML---while mapping    forum.hibernate.org

Hi, i got the follwing error and i could not proceed. 11:50:14,185 INFO Configuration:332 - Mapping resource: persistance/MyCompany.h bm.xml 11:50:14,216 ERROR XMLHelper:48 - Error parsing XML: XML InputStream(2) The proc essing instruction target matching "[xX][mM][lL]" is not allowed. 11:50:14,216 ERROR Configuration:296 - Could not configure datastore from input stream org.dom4j.DocumentException: Error on line 2 of document : The processing instr uction ...

52. Turning off XML mapping    forum.hibernate.org

Hello again - now that I finally have get/set XML functions working I have run into more problems!! I don't believe the or org.hibernate.type.AnyType can be set to XML!! I get - java.lang.UnsupportedOperationException: any types cannot be stringified which is a pain but I could live with that!! BUT WHEN I TRY TO REMOVE THE node mapping from my ...

53. how to map a table which contain XML file as one column????    forum.hibernate.org

Our product has a similar problem, and here is what we did: 1. Added real columns for data that comes from the XML, in addition to the BLOB for storing the XML itself 2. Gave each additional column a public getter and a private setter, use access="property" 3. Mapped the XML property with access="field" 4. Added a getter and a setter ...

54. Future of XML mapping files?    forum.hibernate.org

Temporal Property mapping has nothing to do with time-slicing. And afaik the Java 5 enums is equally supported in hbm.xml afaik. You can just use the type defined in the annotations package in the hbm.xml. again of course EJB 3 can use some of the enhancements in Java 5 we cant directly support in Hibernate for compability reasons - but again, ...

55. Object-to-XML-Mapping    forum.hibernate.org

56. XML Mapping of     forum.hibernate.org

I have mapped simple Composite id and am getting the following exception. Any idea whats wrong and where??? Hibernate version: 3.0 Mapping documents: Full stack trace of any exception that occurs: 15:02:58,813 INFO [TilesRequestProcessor] Tiles definition factory found for request processor ''. 15:02:59,063 INFO [Environment] Hibernate 3.0 15:02:59,094 ...

57. XML Mapping - (Hibernate3 new feature)Can i save a complete    forum.hibernate.org

child persistence of course depends on many things, I would expect it follow the Hibernate configuration regarding cascades - but haven't really tried that. Did you try that with arbitrary nested elements, or with a mapping of a cascaded set of children? I'm in the same boat and would hope to get that working.

58. XML mappings and ID generation    forum.hibernate.org

I'm using the latest version of Hibernate and have a couple of questions about ID generation when persisting XML entities. I saw nothing in the docs that said ID generation was not supported for XML persistence? During my testing, Hibernate throws the exception (shown below) if I try to save the XML with ID generation:

59. XML mapping question    forum.hibernate.org

...

60. Object-to-XML DB mapping?    forum.hibernate.org

61. how to write an one-to-one mapping xml?    forum.hibernate.org

okay, here is the problem. i have two tables user and userprofile. in user table, i have the basic info and in userprofile table, i have more specific info. they have the same pk as uid. now i wanna be like when i access the user table, i only get the info from the user table. on the other hand, when ...

62. my mapping xml file giving the following error    forum.hibernate.org

ERROR [XMLHelper] Error parsing XML: XML InputStream(7) The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array|query-list)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*)". this is my xml file can anyone let me what isthe mistake am doing thanx in ...

63. Map in xml file    forum.hibernate.org

Hello, i need persist a class in a xml file, i see documentation and find Chapter 18. XML Mapping 18.1.2. Specifying only an XML mapping but i can't find the configuration to my hibernate.cfg.xml to tell it don't use a data base, use a xml file to persist my class

64. XML-Relational mapping    forum.hibernate.org

Hi there, I was wondering if someone was able to help me out with the following. I have created a Hibernate mapping file that maps POJOs to both a database and an XML file. Lets say xml looks like this: Blabla djfh lksdjhlsdkjhasdf My db like this: table: Messages columns: id, person, message My pojo like this: ...

65. Can I make a map without XML, just with java?    forum.hibernate.org

66. Mixing Annotations with XML-based Hibernate Mapping (jBPM)    forum.hibernate.org

Hi, I've got a bunch of code written that uses Hibernate entities using Annotations. I'm using Spring to provide the SessionFactory and I'm developing in Eclipse. (I mention these points, because I'm wondering if I'm having a similar problem to http://forum.hibernate.org/viewtopic.php?t=966926&highlight=parse). Until now, everything has worked well. Recently, I dropped jBPM into my environment, and am trying to set up the ...

67. annotation will replace xml mappings?    forum.hibernate.org

68. Mapping to XML    forum.hibernate.org

Thanks for the help, but I meant namespaces within the XML. The two schema attributes that you pointed me to are for Database schemas, not xsds. I'm looking more for something like changing the result from a query to use namespaces (when using the new to-XML mapping mapping ability). Like this: kontakte yoyo

69. mapping-file orm.xml not included    forum.hibernate.org

70. Mapping an Entity with both annotations and a xml file    forum.hibernate.org

I don't think it's possible. You need the Configuration implementation (AnnotationConfiguration for annotations based one) to build the SessionFactory. Maybe you should precise what your needs are. I don't think there's a lot of places where annotations do not permit what XML does. If so, then just watch the hibernate jira to see if the feature you miss is logged (if ...

71. Hibernate annotation and hibernate mapping xml file    forum.hibernate.org

Currently I am experiencing the problems with the UserCollectionType annotation. I did a research showing that the fix patch for user collection not yet ready. so I am trying to use the xml mapping file for the user collection type, and for others I still use the annotation mapping. Can somebody let me know if this is possible? or does somebody ...

72. Rewriting a xml mapping to annotations    forum.hibernate.org

I'd like to create a bidirectional one-to-many association on a join table using Hibernate. In the documentation, I found an example between Person and Address, why does it use many-to-many on one end. Could someone show me the equivalent using annotations? 7.5.1. one to many / many to one A bidirectional one-to-many association on a join table. Note that the inverse="true" ...

73. Map XML->RDBMS    forum.hibernate.org

75. XML Mapping in Hibernate    forum.hibernate.org

View unanswered posts | View active topics Board index Hibernate & Java Persistence Hibernate Users All times are UTC - 5 hours [ DST ] XML Mapping in Hibernate Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message manikdn84 Post subject: XML Mapping in ...

76. import XML definitions in hibernate mapping files    forum.hibernate.org

Hi, Is it possible to import XML mapping snippets and re-use these across several hibernate mapping files ? The only thing I came across is the Entity Resolver feature and it only seems to be recommended for custom type definition imports. See the following link: http://www.hibernate.org/hib_docs/reference/en/html/mapping.html#mapping-declaration-entity-resolution Im using hibernate 3.2.6 and I want to import the whole class mapping element and ...

78. Direct XML mapping and inheritance.    forum.hibernate.org

Hi, I have a direct-to-XML table representation where I've got a one-to-many representation between two tables that share a lot of the same columns. I want the behaviour to be such that my object representation of the children inherit values from the parent tables ONLY IF the child value for the matching column is NULL. Currently, I am doing XML post-processing ...

79. Mapping a non-trivial XML struvture.    forum.hibernate.org

80. hibernate + xml-to-db mapping    forum.hibernate.org

Newbie Joined: Fri Aug 15, 2008 8:05 am Posts: 1 Hi! I can not save xml tree to db :( I have xml like Hibernate3 can map xml to db. I have created class Property with fields name (id) and parent (many to one) and wrote this mappind: Code:

81. Mapping entity with JPA and Hibernate xml config files    forum.hibernate.org

Hi, I know it is possible to mix features from JPA and Hibernate by using annotations. But is it possible to mix these features using xml config files? I tried to use two config files (Entity.orm.xml and Entity.hbm.xml), one using entity-mappings (JPA) and the other using hibernate-mapping (Hibernate). Each of them would map specific properties of the entity. But when I ...

82. XML to DB mapping, on delete cascade pb    forum.hibernate.org

Hello, I'm new to hibernate. I'm working with XML to Database mapping rather than POJO to database. My database is MySql5. I have 2 tables, parent and child. My hibernate configuration file is the following: com.mysql.jdbc.Driver jdbc:mysql://localhost/test login password 10 true org.hibernate.dialect.MySQLDialect ...

83. Saving child entities in xml    forum.hibernate.org

84. RFE: Mapping by XML    forum.hibernate.org

I am working with a system of hibernate classes, written by another party. The problem is that it has over 150 tables - subclasses and one-to-many buckets. What I would like is if I could tell hibernate that when there's a one-to-many relation, or a subclass, the relation should be mapped not by another table but by XML deposited in a ...

85. problem in mapping a xml file for persistence    forum.hibernate.org

i am trying to persist a xml file. I am facing a problem in getting the data at the parent node. Code is :- database table Code: CREATE TABLE PRODUCT ( id INT UNIQUE NOT NULL, description VARCHAR(45) , sku VARCHAR(45) , list_price FLOAT, base_price FLOAT, order_price FLOAT, ...

86. JPA XML Mapping for IndexColumn    forum.hibernate.org

87. are mapping xml and jpa the only ways to map java classes    forum.hibernate.org

Are mapping xml and jpa the only ways to map java classes? I wondering if there are other methods for mapping that might be faster write from scratch and maintain. The xml file isn't bad by any means, but I'm curious if there is even something slimmer. Or perhaps more convention-based configuration options to slim down the code it takes to ...