Hi there,

I tried during 2 days to change my MySQL db from hibernate using Tapestry5.
My DB is called: panaderia and the table I'm using is Usuario.
There are already 3 fields in this table:
id long
email varchar
login varchar
I want to add a new field  called name from hibernate/tapestry5 (without
modifying directly the DB)

So first of all, is it possible? I'm pretty sure that it's possible.
Could anyone help me resolving my problem? I can change a table if I only
add 
private String name in my entity class?

I followed this link: 
http://blog.markwshead.com/900/tapestry-5-10-minute-demo/
http://blog.markwshead.com/900/tapestry-5-10-minute-demo/ 
(I'm using netbeans 7.1 on ubuntu 10.04.)

Thanks for helping


**********************************************************************************
Hibernate configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC &quot;-//Hibernate/Hibernate
Configuration DTD 3.0//EN&quot;
&quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;>
<hibernate-configuration>
  <session-factory>
    <property
name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property
name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property
name="hibernate.connection.url">jdbc:mysql://localhost:3306/panaderia</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.connection.password">root</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
  </session-factory>
</hibernate-configuration>

**********************************************************************************
Usuario.class:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.panaderia.entities;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import org.apache.tapestry5.beaneditor.NonVisual;

/**
 *
 * @author cocu
 */
@Entity
public class Usuario implements Serializable {
    
    @Id
    @NonVisual
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    private String login;
    
    private String email;
    
    private String name;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
        
}



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Hibernate-Tapestry5-MySQL-database-tp5528748p5528748.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to