• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity bean question

 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you advise me on this question please?

Statement: "CMP fields must be declared in the entity bean class".

- This question according to HFEJB is said as FALSE. is that cause of "must" ?

- aren't the virtual fields declared in the entity bean object?

Tks in advance!!!
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
pay attention to the words :

All CMP data fields defined within your bean must be declared within the deployment descriptor in the <cmp-field> element.

And CMP fields must be defined in the entity bean class (with getters/setters)
[ August 07, 2007: Message edited by: Celinio Fernandes ]
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
felipe said:

Could you advise me on this question please?

Statement: "CMP fields must be declared in the entity bean class".

- This question according to HFEJB is said as FALSE. is that cause of "must" ?

- aren't the virtual fields declared in the entity bean object?

Tks in advance!!!


Its true the answer is false

consider these methods in the bean

public abstract void setName(String name)
public abstract void setAge(Integer name)
public abstract String getName()
public abstract Integer getAge()


you dont define the fields like

private String name;
private Integer age;
 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right, right Celinio and Amol !!!

It does even make sense!!! That's about FIELDS rather than gets/sets!!

Tks so much!!! ;-)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic