-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Eclipse 3.1M5 and Annotations
PostPosted: Wed Mar 23, 2005 1:24 pm 
Newbie

Joined: Thu Dec 18, 2003 4:13 am
Posts: 19
Hibernate version: 3.0RC

Mapping documents:none - using annotations

Hello,

First, sorry if this question was already posted, I did not find any help before sending this new post.

I am using Eclipse3.1M5 + jdk1.5 (under WindowsXP) and I would like to test the new annotations'extension. I have a Java project which contains the Hibernate 3.0RC jars + the two jars provided with the Hibernate-annotations-3.0-alpha-3.zip (hibernate-annotations.jar and ejb-3.0-edr1.jar).
When I simply copy/paste the following sample code from the hibernate annotations' page (http://annotations.hibernate.org)


Code:
@Entity(access = AccessType.FIELD)
public class Customer implements Serializable {
   
    @Id;
    Long id;

    String firstName;
    String lastName;
    Date birthday;

    @Transient
    Integer age;

    @Dependent
    private Address homeAddress;

    @OneToMany(cascade=CascadeType.ALL")
    @JoinColumn(name="CUSTOMER_ID")
    Set<Order> orders;

    // Getter/setter and business methods
}


I have many errors in my workspace saying that the annotations cannot be resolved.

Is there any specific feature to activate or is Eclipse3.1M5 (using sun's jdk 1.5) not abe to compile annotations ?

Thank you in advance
Xavier.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2005 1:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have you enabled jdk 1.5 compliance in your project ? Done under project settings in eclipse.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 24, 2005 3:59 am 
Newbie

Joined: Thu Dec 18, 2003 4:13 am
Posts: 19
Yes, JDK 5.0 compliance is set at workspace-level and my java project uses the workspace's compiler configuration

Xavier.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 24, 2005 5:06 am 
Newbie

Joined: Wed Jan 26, 2005 5:08 pm
Posts: 5
Location: Sydney, Australia
Have you inserted the corresponding import statements?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 24, 2005 5:31 am 
Newbie

Joined: Thu Dec 18, 2003 4:13 am
Posts: 19
ok, I understood : Eclipse cannot auto-import the classes using the keyboard shortcut (Ctrl+Shit+o), but importing them one by one works fine.
Thank you very much !

Xavier.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.