File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes oracle.toplink.essentials Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "oracle.toplink.essentials" Watch "oracle.toplink.essentials" New topic
Author

oracle.toplink.essentials

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 845
i do have a class Car.java

when i do deploy this to GlassFish, i get the following error in log's i am unable to understand the logs.

-------------
import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Embedded;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table(name="Car")
//@IdClass(CarPK.class)
public class Car implements Serializable{


@Id
@Column(name = "id", nullable = false)
protected Long id;

@Enumerated(EnumType.ORDINAL)
@Column(name="horn", nullable = false)
protected HornType horn;

@Column(name="steering", table="user_steering", nullable = false)
@Lob
@Basic(fetch=FetchType.LAZY)
protected String steering;

@Column(name="chasis", nullable = false)
@Temporal(TemporalType.DATE)
protected Date chasisDate;


@Embedded
protected CarAddress carAddress;
}
---------------------

Log's

[#|2008-11-18T21:47:34.083-0500|SEVERE|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=18;_ThreadName=Timer-24;Deployment ErrorException [TOPLINK-0] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------

Exception [TOPLINK-93] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The table [user_steering] is not present in this descriptor.
Descriptor: RelationalDescriptor(Car --> [DatabaseTable(Car)])

Runtime Exceptions:
---------------------------------------------------------
-- Exception [TOPLINK-0] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------

Exception [TOPLINK-93] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The table [user_steering] is not present in this descriptor.
Descriptor: RelationalDescriptor(Car --> [DatabaseTable(Car)])

Runtime Exceptions:
---------------------------------------------------------

;_RequestID=58c2b690-34b2-4bae-862d-0e8b14a2015e;|"DPL8011: autodeployment failure while deploying the application : Deployment ErrorException [TOPLINK-0] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------

Exception [TOPLINK-93] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The table [user_steering] is not present in this descriptor.
Descriptor: RelationalDescriptor(Car --> [DatabaseTable(Car)])

Runtime Exceptions:
---------------------------------------------------------
-- Exception [TOPLINK-0] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------

Exception [TOPLINK-93] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The table [user_steering] is not present in this descriptor.
Descriptor: RelationalDescriptor(Car --> [DatabaseTable(Car)])

Runtime Exceptions:
---------------------------------------------------------

"|#]

[#|2008-11-18T21:47:34.191-0500|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=18;_ThreadName=Timer-24;|[AutoDeploy] Autodeploy failed : C:\Sun1\AppServer\domains\domain1\autodeploy\text_ejb_simple1.jar.|#]



Any iDea?


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

By setting the table attribute of the @Column annotation for the steering field, what do you think is going to happen ? When the container sees this Car entity, what kind of table do you think it will create ?
[ November 18, 2008: Message edited by: Christophe Verre ]

[My Blog]
All roads lead to JavaRanch
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402

@Column(name="steering", table="user_steering", nullable = false)
@Lob
@Basic(fetch=FetchType.LAZY)
protected String steering;

---------------------

Log's

Exception [TOPLINK-93] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The table [user_steering] is not present in this descriptor.
Descriptor: RelationalDescriptor(Car --> [DatabaseTable(Car)])


Incorrect..
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 845
thanks Guy for the reply, i solved the above problem like this


---------------import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Embedded;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;


@Entity
//@Table(name="Car", uniqueConstraints= {@UniqueConstraint(columnNames={"id"})})
//@IdClass(CarPK.class)
@Table(name="Car")
@SecondaryTable(name="user_steering", pkJoinColumns=@PrimaryKeyJoinColumn(name="id"))
public class Car implements Serializable{


@Id
@Column(name = "id", nullable = false)
protected Long id;

@Enumerated(EnumType.ORDINAL)
@Column(name="horn", nullable = false)
protected HornType horn;

@Column(name="steering", table="user_steering")
@Lob
@Basic(fetch=FetchType.LAZY)
protected byte[] steering;

@Column(name="chasis", nullable = false)
@Temporal(TemporalType.DATE)
protected Date chasisDate;


@Embedded
protected CarAddress carAddress;
}
---------------------------------------


I forget to mention this description

@SecondaryTable(name="user_steering", pkJoinColumns=@PrimaryKeyJoinColumn(name="id")

So that's why Oracle TopLink was asking for Description.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

That's right, you needed to use a secondary table
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: oracle.toplink.essentials