alfred jones

Ranch Hand
+ Follow
since Apr 19, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by alfred jones

How do I manage binding the data from jsp to bean in Struts 2?

I want to alter data when its binded to the bean property. How do I do it ?
12 years ago

alfred jones wrote:

Tim McGuire wrote:I just realized the documentation I linked to is for OC4J, which has a subset of the annotations. In other words, forget that link

If you are like me and have an object in your database called a "sequence", then you want something like this:





You have ...

generator = "hch_sequence"
name = "hch_sequence"
sequenceName = "hch_sequence"

Do I need keep all similar names ? if not which names could be different ?


However, I dont have "sequence". MySQL does not support sequence. I have put id field as auto increment in MySQL database. Is it not possible using JPA in MySQL ?



comments please

Tim McGuire wrote:I just realized the documentation I linked to is for OC4J, which has a subset of the annotations. In other words, forget that link

If you are like me and have an object in your database called a "sequence", then you want something like this:





You have ...

generator = "hch_sequence"
name = "hch_sequence"
sequenceName = "hch_sequence"

Do I need keep all similar names ? if not which names could be different ?


However, I dont have "sequence". MySQL does not support sequence. I have put id field as auto increment in MySQL database. Is it not possible using JPA in MySQL ?

Tim McGuire wrote:

alfred jones wrote:Thanks.
I will have a database autoincrement id. Do i need to keep an id field in entity class?



Yes, if you read the documentation I linked to, you will see that there are extra annotations for letting EJB know that the database will generate autoincrement id.



Ok. I have visited the link . Its very much confusing.

I see it has @GeneratedIdTable and @TableGenerator annotation . I am not yet sure which particular annotation will fit my requirement for database autoincrement id .

Are both annotations doing same thing ?
Thanks.
I will have a database autoincrement id. Do i need to keep an id field in entity class?
Did you made a typo ? Is not Id annotation should be placed before a field property ? You have put before getter mehod.

Prabhakar Reddy Bokka wrote:Yes. It is database table name.



I have table name as tbl_book_bank ..... I'm worried because my table name has underscore _ symbol....... is it allowed ?



How do you put primary key and foreign key in entity class ? Is it required or container will do this for me ?
I found this code in tutorial for EJB 3.0 entities.

@Entity
@Table(name="bookbank")
public class BookBank implements Serializable {
long id;
String title;
String author;
double price;


what is "bookbank"? is it the database table name ?

Mohamed Sanaulla wrote:I think the diagram explaining Aggregation should be using listOfClasses instead of listOfStudents.



me too.


A neatly explained Aggregation diagram here.



I have visited your link . you know the trouble with that link is it has mixed all the concepts in one example .But I'm just trying to learn individually first. And hence that link is quite hard for me at this moment. I did not like that link . Thanks for your time anyway.

Definition for Whole-part relationship.



not comfortable. what I understand is , Whole= entire thing and part = a small part of the Whole .... but what is Whole-part ?

this is bit confusing as to how we map these in the relationships .

Ran Pleasant wrote:To indicate that the Class object cannot exit without the Professor object then the diamond head of the aggregation would need to be filled in, usually with black.



This is called Composition and again similar to aggregation|association.



Excellent . thanks for the information.

Ran Pleasant wrote:Alfred

The diamond head of the aggregation symbol is clear. That means a Professor object will aggregate zero or more Class objects but that the Class objects can exist without the Professor. To indicate that the Class object cannot exit without the Professor object then the diamond head of the aggregation would need to be filled in, usually with black. The diagram you posted makes sense because a college class is often scheduled before a professor is assigned to teach the class.



not clear. still have confusion. The confusions are at these places ..

>>>That means a Professor object will aggregate zero or more Class objects but that the Class objects can exist without the Professor.

"aggregate zero or more Class objects" ? I think you are saying this because as there is a symbol like 1..* right ? I think you are wrong. it should be called as "aggregate one zero or more Class objects" ...because note we have 1..* not 0..*

Please correct me if I miss something.

>>>That means a Professor object will aggregate zero or more Class objects

I see the Professor object has a field called listOfStudents . We don't know what list it contains . Do we ? We just know it holds a list and the name of the field is listOfStudents.

So,what list it contains? Does it hold a list of Class objects ? How do we know that ? or We are just unsure about that part ?


Excerpt from wiki link http://en.wikipedia.org/wiki/Class_diagram



Aggregation:

Class diagram showing Aggregation between two classes ( figure above)

Aggregation is a variant of the "has a" or association relationship; aggregation is more specific than association. It is an association that represents a part-whole or part-of relationship. As a type of association, an aggregation can be named and have the same adornments that an association can. However, an aggregation may not involve more than two classes.

Aggregation can occur when a class is a collection or container of other classes, but where the contained classes do not have a strong life cycle dependency on the container—essentially, if the container is destroyed, its contents are not.
In UML, it is graphically represented as a hollow diamond shape on the containing class end of the tree of lines that connect contained class(es) to the containing class.


>>> part-whole or part-of relationship ? what does this mean ? I dont understand this part.

>>>if the container is destroyed, its contents are not.
I dont agree. Here if the Professor class is destroyed , then the content list-of-students(List) is also lost....I dont agree the above text.


How do we read the relationship between CoasedGrainedObject and DependantObject ? what is the relationship ?
this is not a new thing....you should not expect good work from MNC's....very unlikely.

i suggest freshers to start work in a smaller company to learn the work....you wont get this kind of opportunity in MNC's
17 years ago
yea, its true that junior developers works heavily and the project depends upon a lot on them ....its like a war where soldiers are fighting.

but one day , you might also a be senior and then you would be elevated to that rank....a good manager has to be a good human being ...he should understand his people ...he should know what to speak and how to speak with individual people because each people are different...it would be a great plus if he is also knowledgeable person but not politician and credit mongers.

trust me , these kind of people wont survive long....he will loose finest people very soon if he continues this.

and to my believe , true knowledgeable persons are of good mind and they help each other.

and about money ? , umm...come on , at least show respect to the seneiority!
they have some work also ...its not that they sit idle ....may be they are not utilizing the brain to solve a complex programming problem but they are using the time in some other work.
17 years ago
congrats for the new innings
[ December 27, 2006: Message edited by: alfred jones ]
17 years ago