-->
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: table with only one column being updated
PostPosted: Sat Jun 07, 2008 9:06 am 
Newbie

Joined: Sat Jun 07, 2008 8:53 am
Posts: 3
Hi,

I have one table with columns (id, c1, c2, c3, ..), the operations on this table is as follows,

1. inserting rows
2. read - c2.c3,... are included in this table to reduce joining
3. only column c1 will be updated. but this is a very frequent operation.

performance wise for update , is this a good design or should I split it into 2 tables and use join to retrieve c2, c3,...?

since only c1 will be updated, is there any trick or feature to make update faster?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 07, 2008 1:33 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
yes you can exclude the other fields from generated SQL for updates;
using annotations there is an option "updatable" on @Column

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 08, 2008 9:31 am 
Newbie

Joined: Sat Jun 07, 2008 8:53 am
Posts: 3
thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 08, 2008 10:36 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Indeed, you may find the column annotation heplful. Here's the various options that are available:

Code:
@Column(
  name="columnName";
    boolean unique() default false;
      boolean nullable() default true;
        boolean insertable() default true;
          boolean updatable() default true;
  String columnDefinition() default "";
    String table() default "";
       int length() default 255;
          int precision() default 0;
            int scale() default 0;
)

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 09, 2008 7:58 am 
Newbie

Joined: Sat Jun 07, 2008 8:53 am
Posts: 3
Thanks.

Cameron McKenzie wrote:
Indeed, you may find the column annotation heplful. Here's the various options that are available:

Code:
@Column(
  name="columnName";
    boolean unique() default false;
      boolean nullable() default true;
        boolean insertable() default true;
          boolean updatable() default true;
  String columnDefinition() default "";
    String table() default "";
       int length() default 255;
          int precision() default 0;
            int scale() default 0;
)


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.