Hallo, I work with JPA for the first time.
My database:
Customer : ID | NAME | other columns
Product : ID | DISCRIMINATOR | NAME |other columns | HARDWARE_INTERFACE |
XML_ID
Customer_Product_Rel: CUSTOMER_ID | PRODUCT_ID | AMOUNT
My objects:
@Entity
CustomerDTO: attributes like id, name ... and
List<ShoppingCartPropertiesDTO> products = new
ArrayList<ShoppingCartPropertiesDTO>();
ShoppingCartPropertiesDTO: private ProductDTO product = null; private
Integer amount = null;
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "DISCRIMINATOR", discriminatorType =
DiscriminatorType.STRING, length = 2)
abstract class Product: id, name ,descr, ...
@Entity(name="SoftwareDTO")
@DiscriminatorValue("SW")
public class SoftwareDTO extends ProductDTO: private SystemRequirementsDTO
systemRequirements = null; private String language = null;
My question: Can I map the customer with a list of the additional object
(ShoppingCartPropertiesDTO) which contains the product and the amount? And
how is the ManyToMany annotation ?
An additional question: What means the exception with missing descriptor ??
Exception Description: Missing descriptor for [ShoppingCartPropertiesDTO].
Verify that the descriptor has been properly registered with the Session.
at
oracle.toplink.essentials.internal.ejb.cmp3.transaction.base.EntityTransactionImpl.commit(EntityTransactionImpl.java:120)
at
oracle.toplink.essentials.internal.ejb.cmp3.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:60)
at test.JPATester.runTest2(JPATester.java:186)
Caused by: Exception [TOPLINK-7009] (Oracle TopLink Essentials - 2.0 (Build
b58g-fcs (09/07/2007))):
oracle.toplink.essentials.exceptions.ValidationException
Thanks for all posts
David
--
View this message in context: http://www.nabble.com/ManyToMany-with-list-of-an-utility-class-which-contains-the-other-objekt-f%C3%BCr-mapping-and-an-additional-attribute-tf4470610.html#a12746960
Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.