-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate *order of the fields of the class*
PostPosted: Fri Oct 24, 2008 2:25 pm 
Newbie

Joined: Wed Oct 22, 2008 3:16 pm
Posts: 1
someone know how do to hibernate follow the order of the fields of the my class (order of the fields of the class == order of the columns in table )

class processo
Code:
   @EmbeddedId 
   private ProcessoPk      processoPk; 
         
   @Column(length=1, nullable=false) 
   private String          situacao; 
   
   @Column(name="tipo_vitima", length=30) 
   private String          tipoVitima; 
             
   //set and get 



class ProcessoPk
Code:
@ManyToOne 
@ForeignKey(name="fk_processo_empresa") 
     @JoinColumn(name="empresa",columnDefinition="INTEGER",nullable=false) 
private Empresa     empresa; 
       
@Column(name="ano",columnDefinition="INTEGER",nullable=false) 
private Integer     ano; 
       
     @Column(name="processo",columnDefinition="INTEGER",nullable=false) 
private Integer     processo;

//set and get





Code:
CREATE TABLE PROCESSO   

ANO                                          INTEGER         NOT NULL, 
PROCESSO                                INTEGER         NOT NULL, 
TIPO_VITIMA                             VARCHAR(    30)  COLLATE NONE, 
SITUACAO                                VARCHAR(     1) NOT NULL COLLATE NONE, 
EMPRESA                                 INTEGER         NOT NULL, 
PRIMARY KEY (ANO, EMPRESA, PROCESSO) 
)


The column in table doesn't follows the same sequence the class.

thanks!
excuse-me my english


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.