i make a customer object persistent

                        // create a new customer
                        customer = new Customers();

                        // fill with data
                        customer.setEmail(email);
                        customer.setPassword(password);

                        // make persistent
                        customersFacade.save(customer);
                        
after persists i know the new id is in db 11, but if i log its 0
why it won*t set automattically
                        log.info("customer ID: " + customer.getCustomersId());

entity has this:

@Entity
@Table(name = "customers")
public class Customers implements Serializable {

        // ------------------------------------------------------ Manifest 
Constants

        private static final long serialVersionUID = 5L;

        // ------------------------------------------------------- Public 
Properties

        private long customersId;

        private String firstName;

        private String lastName;

        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name = "customers_id")
        public long getCustomersId() {
                return customersId;
        }

...

should work or how it works?


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972713#3972713

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972713
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to