1. Create DetachedCriteria for two types without association forum.hibernate.orgHello, I need to create a DetachedCriteria for two types without association. Course ------------ id, name Teacher ----------- id, name Review -------------- type, id, score Review type can be Course, or Teacher. Id is the course id or teacher id depending on type. Query is: list all teachers reviewed order by score desc. HQL: select t from Teacher t, Review r ... |
2. How to set sql types in association tables with XDoclet forum.hibernate.orgI am using Hibernate 2.1.4 with XDoclet 1.2.1. I have a unidirectional many-to-many association A * -------> * B A and B have primary keys of type String (char(32)). I want to generate the association table with the 2 foreign keys if type char(32). This XDoclet tags: * @hibernate.set * role="bs" * table="A_B_LNK" * lazy="true" * cascade="save-update" * @hibernate.collection-key * column="A_ID" ... |
3. Custom value type with association forum.hibernate.orgHow can I define a Custom Value Type that has a Many-to-One association? ---- Sample ---- In this case I want to define a custom value type to persist the property address of the customer. -- Customer - String name Address address -- -- Address - String street City city -- -- City - String name -- |
4. Specifying type of a foreign key association (not integer) forum.hibernate.orgHibernate version: 2.x Name and version of the database you are using: Postgresql 7.4 Hello Let's say I have a parent table with two fields : id as primary key,parent_name varchar as unique key, and a child table with two fields : id, parent_name varchar with a foreign key contraint referencing the column 'parent_name' in the parent table. I know using ... |
5. Association type? forum.hibernate.orgHi, I have a Customer object with primary key customer_id. I would like to store a record for each customer called CustomerCarrierData in a separate table. There will be only 1 CustomerCarrierData record per customer. But, instead of storing the pk of CustomerCarrierData in the Customer table, I would like to store the customer_id from Customer in the CustomerCarrierData. When I ... |