1. NHibernate: How can I combine fields from two classes? stackoverflow.comHere is a simplified version of my database model. I have two tables: "Image", and "HostingProvider" which look like this: [Image]
|
2. Hibernate - @ManyToMany with additional fields in mapping entity stackoverflow.comMy simplified Entity Scenario is as follows: A PERSON is associated to a COMPANY in a specific ROLE (yawn). My first thought was to configure a ManyToMany relationship between PERSON and COMPANY. However and ... |
3. @ManyToMany Hibernate Question (can add extra field?) stackoverflow.comI have these two class(table)
|
4. Mapping a ManyToMany across join/link table using 3 ID Fields stackoverflow.comIs it possible to use a @ManyToMany mapping across a join using 3 PK columns? I'm fairly certain this is not possible and the solution is to expose the entity using @OneToMany ... |
5. Mapping Calculated Fields in Hibernate stackoverflow.comI'm not sure if this is possible in Hibernate but it would be really great if it was :) I've not actually got past the conceptual stage with this but I'll ... |
6. Add Java Annotation to inherited field stackoverflow.comI'm working on something that might benefit from a pattern like the following:
|
7. Mapping a property to a field from another table in NHibernate stackoverflow.comconsider the following class:
|
8. What is a good solution to link different tables in Hibernate based on some field value? stackoverflow.comI have |
9. Stopping Hibernate from trying to get a calculated field from the database stackoverflow.comI have a property of a business object which is calculated. The calculation involves some of the logged in user's details, and so can't be represented as a simple SQL ... |
10. See if field is mapped stackoverflow.comIs it possible to detect if a certain field of a given class has been mapped? E.G. I have the object;
And in the mapping file;
|
11. Is it possible to map a field in an Entity without defining any association? stackoverflow.comI've got the following schema in DB (simplified)
|
12. @Manytomany add extra field with no join Entity stackoverflow.comI created a @ManyToMany relation between two table, without have a relational entity through them. Something like this:
|
13. JPA map non-id field as foreign key stackoverflow.comI have two entities as follows:
|
14. How to join a Map field with hibernate's Criteria stackoverflow.comI have the following problem
|
15. is it possible to ignore some field when mapping in annotation,Entity class stackoverflow.comI am using Hibernate to map with MySQL I have an entity class in which I have the methods mapped with columns in MySQL The question is, if its possible that ... |
16. Join fields from from related table into Map stackoverflow.comHello I have two tables: roles and permissions. Roles have name and other things. Permissions have id, idrole, string sname and boolean bcanmodify. (Relation many to one between role and permission) I ... |
17. How to map an searh object to a class witth more fields with JPA annotations coderanch.comHi at all, I'm a neewie with JPA. I need to map a search object to a table. The search object has only and id, name. The big object has more fileds id, name, adress and more. I use this as big object @Entity @Table(name="users") public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String name; private String ... |
18. Discard fields mapping/initialize during execution time forum.hibernate.orgI have a POJO as below public class CategoryVO implements Serializable, Cloneable { private long categoryId; private String categoryName; private List |
19. Howto get Fields of mapped class ? forum.hibernate.orgI want to create a generic method of creating backups of my mapped entities. They all look like this: Code: |
20. Query vs. mapped ID field forum.hibernate.org |
21. Map to only certain fields in a table forum.hibernate.orgIs it possible to map to only certain fields in a Database table. For example: I have a table with 10 fields but really only ever need 2. So I create a class with 2 attributes and map to those 2 specific fields in the DB in my xml file. Is there a way this can be done, or do I ... |
22. Is it possible to map on a field instead of a class ? forum.hibernate.orgHello, I used to have something likes this : A Code: Person has a Code: Name and an Code: Address ... So i create mappings for a person, name and address. But I would like to use a generic Object (TransferObject). This TransferObject holds a map with it's properties. To give an example for an Address : Address is an empty ... |
23. Can I map from non-key field to part of a comp-id? forum.hibernate.orgI have 2 tables related by a string field. Table A contains the string field but it's not part of the primary key for the table. Table B contains the string field as part of a composite ID. Can I map a one-to-many collection from A to B based on the string field being the same? (A containing a collection of ... |
24. mapping individual fields to different tables forum.hibernate.orgI have an application that logs events to a history table, and my clients want some of the event fields to be saved into their existing DB schema, which has the fields spread out across several different tables. Is it possible to configure Hibernate to store individual fields of a class in different tables without creating a separate class to contain ... |
25. mapping of table columns to javabean fields forum.hibernate.orgI am just learning Hibernate. I have a question: Hibernate allows to auto generate a javabean from an XML describing the mapping of table columns to javabean fields. I have situation, say I have 'Borrower' table with column 'name'. It has both firstname and lastname in the column. I would like to add getFirstname() and getLastname() to the mapped object. On ... |
26. How to implement mapping tables with additional fields forum.hibernate.org |
27. Hows does one map the fields of a class to different tables? forum.hibernate.orgIn addition to the usual Class -> Table mapping, two other ways of mapping a class are sometimes possible in an Object/Relational framework: 1) Mapping the fields of a table to multiple classes. 2) Mapping the fields of a class to multiple tables. The canonical example of (1) is mapping the zip code field of an address table to its own ... |
28. How can I query using a map of (field, field-value) ???? forum.hibernate.org |
29. How doing an OR cirteria on field are in parent and in child forum.hibernate.orgselect mx.status, bs.status from bs, mx WHERE bs.EXTERNAL_REF_ID = mx.NETDEALID (+) AND (bs.status in ('error') ... |
30. question regarding an update on mapped fields only forum.hibernate.orgHi all I have a question re. the best way to deal with the following scenario when it is needed to update only fields that are mapped in a persistent object. In other words, suppose there is the following hierarchy: Hibernate version: version 2.0.3 Code: public class MyObject { private String firstName; ... |
31. Mapping a fixed character field forum.hibernate.orgHi all, I've got a db table (Oracle9) which has a fixed character field as PK (trn_id CHAR(16)). Problem is that the values in this field are not always 16 characters long which means Oracle adds as many spaces as necessary to get to 16. I've now done a Hibernate mapping of this table using the string type to map this ... |
32. Mapping foreign key relationships with type field. forum.hibernate.orgHi, I am new to Hibernate but loving it so far. I have found a couple of cases where I am not able (so far) to get hibernate to map the db to the object model I am trying to use. I have a couple of work arounds figured out, but I am hoping someone can offer a more elegant solution. ... |
33. Possible incorrect mapping of fields in 3.0.2 forum.hibernate.orgBeginner Joined: Wed Dec 17, 2003 2:54 pm Posts: 26 Location: Oslo, Norway It seems to me there is either a bug or the possibility of a nice extension of error reporting in Hibernate 3.0.2. Below, the RefPTR field is the 10. field in the insert sql. The value of this property is being mapped as the fifth parameter. This looks ... |
34. mapping joined table field forum.hibernate.orgHibernate version: 3.0.5 Mapping documents: |
35. how to map not all fields but still be able to use them? forum.hibernate.orgI'm integrating with a legacy app. One of the tables has all regular data fields, each of which could be changed on client side, so my DAO and Service interfaces look like: void insert(Foo foo); void update(Foo foo); There are though a couple of fields that require a special treatment: IS_DELETED and IS_AGENT. To change any of them a user has ... |
36. Possible to do Field Inheritance? forum.hibernate.orgI have a lot of persistent classes. They all descend from a particular base class in my java that has some core fields that I want every object to have e.g. createdOn createdBy lastUpdateOn lastUpdateBy For my java, it's a no brainer. If I add a new class "foo" and I subclass "parent", it gets those four fields automatically by virtue ... |
37. Mapping a field as type="text" and character sets forum.hibernate.orgBeginner Joined: Wed Feb 23, 2005 11:29 am Posts: 26 Should I be able to simply map a java.lang.String property as type="text", have the string data stored as a CLOB and read and write to that field? The data in the java.lang.String is a bas64-encoded GIF file. With one version of the JayBird JDBC driver I get the "charsetName" exception when ... |
38. mapping fields with a collection forum.hibernate.orgI have a table with several fields that have the same properties (the same data types, the same sizes,...). I have also other fields in this table. Is it possible to map the fields that have the same properties directly with a collection ? --> The fields that have the same properties must be directly mapped with a collection in the ... |
39. final field...how do I map?? forum.hibernate.orgHi, I have this small problem. I have a class like.. public class TimePeriod implements Serializable { private Integer id; private final long startTimestamp; private long endTimestamp; protected TimePeriod() { startTimestamp = 0; } public TimePeriod(long startTimestamp, long endTimestamp) { this.startTimestamp = startTimestamp; this.endTimestamp = endTimestamp; } public void setEndTimestamp(long endTimestamp) { this.endTimestamp = endTimestamp; } public void setStartTimestamp(){}////what do I ... |
40. Inheriting class with Non persistence fields forum.hibernate.orgI have a generic CONTENT table in the Database that holds all the images and PDFs and other binary content. There is a CONTENTTYPE table to distinguish different types but ContentTypeID is not FK in CONTENT table. Instead, ContentTypeID is used as a PK of a table called PERSON_CONTENT to associate different types of content for a given person. In Java ... |
41. One class having several fields to Multiple Tables mapping forum.hibernate.orgDear Sir, In response to your reply, I worked accordingly, but I was getting exception like org.Hibernate.HinbernateMappingException. Now I want to make my question more clear and lucid. My requirement is that I have a class like this public class Employee { Long id; String firstName; String lastName; String designation; String address ; String emailId; int age; int salary; } I ... |
42. Mapping Oracle Text Score field Using Hibernate forum.hibernate.org |
43. Foreign key mapping to non-id field possible? forum.hibernate.orgI want to create a set collection relationship between two classes Foo containing many Bar objects. However, due to data constraints I need to have the foreign key for the collection be the "customKey" property rather than the "id" property which usually serves as foreign key. I've experimented with a few configurations but no matter what config I try I cannot ... |
44. Mapping other tables' fields forum.hibernate.orgOk. I've been around this so many time and, as much as I believe this might be easier than I think, I just can't get to a solution. My problem is this: I have a database with tables I'm not allowed to alter. I also have a class diagram with extensive use of inheritance that I dind't want to alter much. ... |
45. How to map "Map |
46. **Map association table fields to object in collection?** forum.hibernate.orgI just moved the address type from the address table to the person_address table but I dont want to change my classes - only the mapping file. I have 3 tables: person (person_id, last_name, ...) person_address (address_id, address_type, person_id) address(street, city, ...) I have 2 classes: public class Person { private Set addresses = new HashSet(); private String lastName; .. } ... |
47. Field-to-method mapping for fields like "yAxis"? forum.hibernate.orgI've got a set of classes which contain objects with names like yAxis, which are accessed through get/setYAxis(...) methods (note the capitalisation). When I attempt to map these fields with something like Code: |
48. Mapping multiple multilingual fields in a single table forum.hibernate.orgNeed help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hi, We've got some troubles mapping multiple multilingual fields in a single table. Basically what we're trying to do is mapping an entity (Accommodation is this case) that has some single language properties and some other multilanguage properties that are stored in a Map |
49. Mapping aggregate field to class-property forum.hibernate.org |
50. Mapping a link table with additional fields forum.hibernate.orgHello I'd like to map a many-to-many relationship to a table I have BUT the linking table also holds additional information (about the relationship). Does anyone know how to do this? This is what I have: [A]>---<[L]>---<[B] This would be a fairly straightforward many-many mapping, but table L has another field (called 'state') which represents additional info about the relationship between ... |
51. How to map an immutable class/fields? forum.hibernate.orgpublic class Question { private final String name; private final String value; public Question(String name, String value) { this.name = name; this.value = value; } ... |
52. Problems mapping an auto incremented field forum.hibernate.orgHello all! I'm new in Hibernate annotations. I have a problem mapping an Entity. Description: I have an Entity with an EmbeddedId: @EmbeddedId @AttributeOverrides( { @AttributeOverride(name="uuid", column = @Column(name=PAYMENT_TRANSACTION_ID) ), }) private EntityPK pk = new EntityPK(); This entity also has a field, that should be auto incremented by the database. @Column(name=PAYMENT_TRANSACTION_INVOICENR, length=9, insertable=false, updatable=false, unique=true) @Generated(value=GenerationTime.INSERT) private int invoicenr; The ... |
53. Mapping a set with multiple-fields key forum.hibernate.orgI have a table "Questions" with a key formed by fields "id_question" and "id_prog_question" (a counter). Each question may have a set of children questions, bounded to the parent question by a key formed by fields (parent_id,parent_prog). How can I model this set? |
54. Mapping fields from JOIN table... forum.hibernate.orgMy setup is below. I'm wondering how I can setup a mapping document given the table definitions I have. As you see the JOIN table gems_partner_activity table contains partner_id and activity_id, so that I can specify a bi-directional relationship for both partner and activity relationships (Partner has Activities and Activities have Partners defined). In addition, however, there are three values in ... |
55. How to map a bit field forum.hibernate.orgHi everybody I am new in this forum so first of all sorry if I do something wrong. I am also new with hibernate. I have read some tutorials and at least I have it running with a very simple application. I use hibernate 3.2, postgresql 8.1 and Eclipse 3.3 with java jdk 1.6. My problem is that I have a ... |
56. map multiple objects to a single field? forum.hibernate.org |
57. mapping a calculated field as a foreign-key forum.hibernate.orgAs I understand you can map one table to an other using the foreign-key / primary-key relationship. I have a slightly different scenario because of a legacy AS400 Database. Table A has a column C, which can be used to map to the primary key of Table B. However, columnC can't be used as is. Only two digits of the value ... |
58. mapping fields from multiple database forum.hibernate.orgDB1 Sales Table salesId customerId grandTotal userId ------------------------------------------------------ DB2 Users Table userId username password ------------------------------------------------------- hibernate does not let me map userId in sales table since Users Table exist in different database. P.S. Im using ... |
59. Field from chield table as a key of Map on many-to-many RS. forum.hibernate.org
|
60. Foreign key field in mapping file forum.hibernate.orgHi, I am trying to find solution and approach for a common task in my projects. I have a class and I want to use a mapping file to fill the properties of this class. Also, I have a table which stores the data for this class. And I have a foreign key in this table that points to onother table. ... |
61. How to map a field which might be persisent or value? forum.hibernate.orgHi, How do I map a field which could be a persistent class or a value type? The |
62. Saving a field which is a Map forum.hibernate.org |
63. Problem accesing fields in one child - many parents scenario forum.hibernate.orgHi, I don't understand why you can't just get the "baseTable" entity by using hibernate, and then use "getParent1()" and "getParent2()" (and so on...) to retrieve your data. This getters would return null for the non-existent parents, you don't need to specify additional "were" clauses. Also a thing you could do is mark your entity as abstract and inherit it 5 ... |
64. Best hibernate type to use, to map to a db char field > 1 forum.hibernate.orgHi, Does anyone know the best hibernate type to use when mapping from a Java String to a db charater field, larger than 1 in length, in the hbm file. We have been using |
65. How to includes field of mapping table for many-to-many forum.hibernate.orgHello, we have a many-to-many realtionship where the mapping table besides the respective foreign keys contain additional fields that need to be filled when a new entry is inserted into the mapping table. The question is now how the values for these additional fields can be inserted. In the category-item example in the hibernate docs the mapping table CATEGORY_ITEM is only ... |
66. creating a new non-mapped field in an object forum.hibernate.orgHi there I'm working on a hibernate application of someone else's design, and this is the first time I've used this technology! The application maps to a series of database tables, and represents them as java objects with realtionships between them that mirror the database itself. This I understand. What I'm trying to do now is to establish a relationship between ... |
67. How to build mapping that one table is referred by 2 fields? forum.hibernate.orgAre you saying that you want to duplicate data in two separate database tables? Is there a compelling reason for doing this. A better approach would be to keep the data in one place, and have Hibernate associations between classes reference each other tables' data. So, what's the need for this approach? One thing I do when I need history tables ... |
68. Mapping issue in fatching specific fields from two tables forum.hibernate.orgCase: Class A { int id; string name; string address List blist; } Calss B { int id; string Bname; A aobj; } Get and Set method and requried constructor are impletemented HQL Syntax: Select new A(id,name) from A as a where a.id=2; Above case is correct and running fine and retuning A objects But what I require is that object ... |
69. Mapping static fields or something like that forum.hibernate.orgHi, I would like do have some static fields in my entity which will populated with some domain objects. For example fields for default category - when new entity is created it will automatically assign this default category to category field. class Product { public static Category defaultCategory1 ; @Column Category category ; public Product(boolean isNew) { if(isNew) { category = ... |
70. Map Collections via non-key field? forum.hibernate.orgHibernate version: 3.1 Mapping documents: Name and version of the database you are using: AS400/DB2 Hi, I have 3 classes/tables. One is an Order_Overview, which contains FKs to other tables. Another is Order_Detail, containing an FK to Order_OVerview, and Order Line Items (a one-to-many mapping from Order_Overview to Order_Detail) I have no problem mapping a collection of Order_Details to Order_Overview, as ... |
71. Need Help: Entity class field without mapping forum.hibernate.orgIm using hibernate with annotations My database is 'Oracle' I want to know that is it possible to write a entity class like this : *Table columns are different from this class field names. Code: @Entity @Table(name="TRN_ODEROFSALE") public class OrderOfSale implements Serializable { private String name; private ... |
72. Howto test that all fields of a table are mapped? forum.hibernate.orgHi, context: - an application that uses one entity per table - non java developers that may change the table columns objective: make sure that if anyone add or drop columns, an alert is raised So, can anyone tell me if there is a way to do an introspection on a Entity bean to make sure it maps all fields of ... |
73. How does one map fields in a DomainObject base class? forum.hibernate.orgHow does one map fields in a DomainObject base class using annotations? I'd really like it if Hibernate could inherit the @Id, etc. annotations in all the subclasses, because DomainObject is really very good at defining a quick and dirty equals, as well as some convenience methods like isTransient and stuff like that. If nothing else, I need id and isActive ... |
74. manyToMany mappings with multiple fields forum.hibernate.orgI have a complex type that I wanted to talk through on the forum before I figured it all out. I have a course, material, and menumapping. Fields in menumapping table are as follows: id materialID courseID parent Basically, I need a group of root menu items to be made from Materials depending upon the course selected, then each of those ... |
75. manyToMany mappings with multiple fields forum.hibernate.orgI have a complex type that I wanted to talk through on the forum before I figured it all out. I have a course, material, and menumapping. Fields in menumapping table are as follows: id materialID courseID parent Basically, I need a group of root menu items to be made from Materials depending upon the course selected, then each of those ... |
76. Inheritance - Add a field to each descendant forum.hibernate.orgHi I'm working with a few inherited classes and I have a abstract class as mapped super class. I work with inheritance strategy joined. The class inheritance looks like this: Person -> Employee -> XYEmployee. Everything works fine. Now I want to add to every table in the DB a Field "lastModified" where I want to store the date of the ... |