Hello again!

I'm need to make a classe that works in all databases, in the example of
"Slice" the id is generated by "System.currentTimeMillis()"

But i don't know if exists other way for map this class for oracle,
sqlserver and mysql because there are differents kinds of ids(sequence,
identity, auto). If don't exists a "universal mapping", i was thinking how
can i generate a "UUDI" to be the ID of the tables, but how can i store this
value in database? because if i store this value as string the database will
be slow!! 

How can i make this class "universal" for the databases?

@Entity
@Table(name="produto")
public class Produto implements Serializable {

    @Id
    @Column(name="id_produto")
    private int id;

    @Column(name="vc_nome", nullable=false)
    private String nome;

    @Column(name="dt_insert", nullable=false)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dtInsert;
   
    
}

Thanks!

-- 
View this message in context: 
http://n2.nabble.com/How-can-i-make-my-classes-work-in-all-databases--tp1303283p1303283.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to