--- [EMAIL PROTECTED] wrote:
You need to learn about the mysteries of the
unsaved-value
attribute :)
Hibernate looks at the id value to determine if an
object
discovered by cascade is new or not. So, if you
have an
object with a Long identifier, set
unsaved-value=null.
I noticed that
--- [EMAIL PROTECTED] wrote:
Here the children set in the Parent object is
readonly. Does it mean any modification to any
Child
element in the Children set will not be persisted
to
database( an violation of usual persistence by
reachability)? In
No, it is nothing to do with cascades.
Easy question, I think.
I am trying something like this:
Product p = new Product();
p.setName(blah);
ProductLineItem item = new ProductLineItem();
item.setName(blah line item);
// Add a line item to the product
p.addLineItem(item);
Session.save(p);
.and it is inserting the Product, and
On Thu, 30 Jan 2003 17:17:54 +1100, [EMAIL PROTECTED] said:
So do you want to just do a little experiment to find out
which version(s) support parent for
composite-element, because I forget.
the 1.1 DTD doesn't allow this, and even if i force it in there, it's
apprently ignored... i'm using
You can remedy this problem with MySQL by adding autoReconnect=true in your
JDBC URL. For instance:
jdbc:mysql://localhost/mydatabase?autoReconnect=true
I've also heard that adding a validationQuery parameter will have a similar
effect (at least with Oracle):
parameter
I have a collection of thing. I do not care whether
there is duplication or not. I can use Set to prohibit
duplication. I can also use list and bag.
If I use Set rather than list/bag, I think the
performance is not so good as it is for list/bag,
since set has to limit duplication.
I noticed that
I agree 100%, and I'm puzzled by this.
I posted about that in the Forum on SF,
asking the same questions.
Ok... it's strange... Hibernate uses several metatags to do this.
Defaults SUCK big time if you ask me. And it also uses the same function
for both (getFieldScope). I attached fixed
Ok, I see that the BasicRenderer seems to want some parameter and it
defaults to private, which is insane, I think (should default to
public).
---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something
I added some debug parameters, and you're right that the lookup happens each
time. It sounds to me like the HibernateSession class could be enhanced to
allow only one lookup. Here is a first stab at it:
public class HibernateSession {
//~ Static fields/initializers
Why does CodeGenerator in Hibernate2 generate private getters and
setters?
---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
1. add the child element to the children set.
2. save the child explicitly by calling
Session.save(child).
Is it right?
If you have enabled cascades, you can skip (2).
By specifying readonly, in the code I have to
remember which set is readonly and I have to handle it
differently from
suppose I have two table
create table A (
id integer primary key
);
create table B (
id integer primary key,
idA integer not null,
constraint FK_B_TO_A foreign key (idA) references A
(id) on delete cascade
);
Here suppose A to B is a one-to-many
I'm wondering if there's any problem with the following modifications to
Jeff's Filter. The code below uses the HibernateSession object to obtain a
session in a Filter. Seems to work pretty well for me. If there are any
glaring problems, please let me know. If there aren't any issues with
Just expecially for Max I have done some back-breaking coding (not really,
it was easy as pie) tonight and implemented the behavior he requested,
with respect to collections passed to update(). Collections now carry a
snapshot around with them so that we can update individual rows.
I had
You need to learn about the mysteries of the unsaved-value
attribute :)
Hibernate looks at the id value to determine if an object
discovered by cascade is new or not. So, if you have an
object with a Long identifier, set unsaved-value=null.
Note that another approach is to save() the Item
I'm wondering if there's any problem with the
following modifications to Jeff's Filter.
Yes there is. More new InitialContext() lookups. This was one thing that
Jeff tried to avoid. But yes your approach should work fine, but it
causes a little more overhead (Or have you done some modification
Hi everybody,
I'm a newbye in using hibernate, so I beg you pardon in the question is
dummy :).
I'm using tomcat4 with mysql, and, of course, hibernate. I open and
close the hibernate session with a filter, using a modified version of
the filter published on the mailing list a couple of weeks
Here the children set in the Parent object is
readonly. Does it mean any modification to any Child
element in the Children set will not be persisted to
database( an violation of usual persistence by
reachability)? In
No, it is nothing to do with cascades.
this sense, the readonly applies
to the
18 matches
Mail list logo