I have an entity called commission that has a property of supplier with the
reference to this object set up as below
| @ManyToOne(fetch=FetchType.LAZY)
| @JoinColumn(nullable=false, name=supplier_id)
| public Supplier getSupplier() {
| return supplier;
| }
i forgot to add referencedColumName to the JoinColumn Annotation when defining
the foreign composite key relationship.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3915149#3915149
Reply to the post :
yep.. I finally sorted this one out.
I'll post the code for my files for a reference as this is a slightly different
example to the one in the wiki.
I've included the location class which shows how the composite foreign key is
referenced.
@Entity
| @Table(name=country)
| public class
I have two projects one that references the other. So when I make any
changes... I have to build the first one... package it.. build the second.. run
xdoclet.. package it.. and then deploy.
My question is... is there any way i can write a script that will do all of the
above so I only have to
I'm looking for some clarification on the CascadeType.ALL option when defining
relationships between entities.
Example: the Company entity has a property that is of Contact entity type.
I am now creating a new Company instance and add a new Contact instance to it
with
| Company company =
Thanks Bill,
I'll give that a go an let you know of the results.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3914854#3914854
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3914854
ahh! That makes sense. so simple!
Thanks for that.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3914860#3914860
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3914860
I've just set things up the way you have suggested.
My PK class now has a String value referring to the country_code_1 rather than
the actual country object.
@Embeddable
| public class CountryRegionPK implements java.io.Serializable{
| ...
|
|public String getCountryCode1()
I am trying to build a entity structure where I have a country table that uses
ISO 3166 country codes as their PK, and a region table which also uses ISO3166
codes as a composite PK. For example.. a record in the country_region table
that refers to New South Wales in Australia will have a
TransientObjectException: object references an unsaved transient instance -
save the transient instance before flushing: package.path.Contact
I have a persistence object Affiliate that has a child object Contact.
This is shown in my contact object as
Hi pdog,
Can you tell me which tutorial you used?
Thanks
Dan
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3913041#3913041
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3913041
I have a database relationship of two objects. The tables/objects are Company
and Contact.
Company has a foreign key relationship with Contact. Therefore Contact has a
company property. This field is required, or not nullable.
What I am trying to do is create a contact from scratch, populate
I have just completed creating my par file with pojos and mapping annotations
etc.
I am now trying to deploy the par file and am getting strange errors relating
to java.util.List.
I was getting another strange error earlier that had something to do with
collection not supported yet since then
I didn't want to post my code because there is alot of it.
However, i think i have have solved the problem. And yes you were right.. i had
incorrectly set my annotation relationships.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3910898#3910898
Reply to the
cool, thanks. :D
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3910649#3910649
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3910649
---
This SF.net email is sponsored
15 matches
Mail list logo