posted 8 years ago
You can use print statements to determine the value of an object at a specific point in time.
Ex:
in this case if newStudent didn't meet the condition all of the student fields(i.e. gpa, name, student id) would be empty.
-Hunter
Ex:
in this case if newStudent didn't meet the condition all of the student fields(i.e. gpa, name, student id) would be empty.
-Hunter
"If the facts don't fit the theory, get new facts" --Albert Einstein
posted 8 years ago
@Hunter: what?
@Ilias: Loaded from where? In any case, one of the easiest ways to detect changes would be to compute a hash code, store it, and check against it later. This, of course, depends on having a good hash function, and may not always be appropriate. You could also instrument getters/setters to set a "modified" flag if their values actually cause a change--there are a number of ways this could be implemented.
I'm not sure how Hibernate determines dirtiness, but you could look into that and see what their implementation does.
@Ilias: Loaded from where? In any case, one of the easiest ways to detect changes would be to compute a hash code, store it, and check against it later. This, of course, depends on having a good hash function, and may not always be appropriate. You could also instrument getters/setters to set a "modified" flag if their values actually cause a change--there are a number of ways this could be implemented.
I'm not sure how Hibernate determines dirtiness, but you could look into that and see what their implementation does.
posted 8 years ago
I have written code that will load the property file, which will load only time stamp of previous instance differs with current one. I want to know if the object has got updated of the said class or not.
David Newton wrote:
@Ilias: Loaded from where? In any case, one of the easiest ways to detect changes would be to compute a hash code, store it, and check against it later. This, of course, depends on having a good hash function, and may not always be appropriate. You could also instrument getters/setters to set a "modified" flag if their values actually cause a change--there are a number of ways this could be implemented.
I'm not sure how Hibernate determines dirtiness, but you could look into that and see what their implementation does.
I have written code that will load the property file, which will load only time stamp of previous instance differs with current one. I want to know if the object has got updated of the said class or not.
