Win a copy of Spring Boot in Practice this week in the Spring forum!

Marek Kisiel

Greenhorn
+ Follow
since Sep 26, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marek Kisiel

Thank you for answer.

So if user want to save new customer in db for example, can I use HashMap to send all p values from customer form per once to controller, and next to model?

Hello

I have a problem where should I create my domain model object, (such as Customer, Order, etc...)
I am creating a standalone app for my homework and I am not sure where to create that kind of object.

For example I have a gui form for registering new customer.
And now where I should create Customer object in view, and than send it to controller,
validate properties of the object, next send it to model to store it in db??

Maybe it's a controller function to create an object after getting values from view?

My point is that every examples of mvc are working on simply values such as int, string etc, but what about pojo object?

Could anybody help me?

Regards







Hello

I am getting strange problem with Hibernate.

I have following sourcecode:



In output everything seems to be ok for me:


2009-10-02 18:51:13 org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.3.1.GA
2009-10-02 18:51:13 org.hibernate.cfg.Environment <clinit>
more INFO's....

Customer ID: 0

Name: Name, Surname: Surname
rest of toString() method

INFO: configuring from resource: /hibernate.cfg.xml

more INFO's...

2009-10-02 18:51:16 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: schema update complete
Hibernate: insert into Adress (street, number, city, zip, region, country, state) values (?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into ContactInfo (cell, phone, fax, email) values (?, ?, ?, ?)
Hibernate: insert into Customer (name, surname, created, adress, contact, company) values (?, ?, ?, ?, ?, ?)
Customer ID: 1035
..toString method()
Created: null



Notice that ID has changed, it means that hibernate properly assigned auto increment value from db, however created properties which is current timestamp is null
and I have no new row in the db.
It's strange but if I do the same insert operation in a simply class without getting customer from view it works, just put customer object creation to main() method everything works fine.

Could anybody give me any advice, please?

Regards


Hello

I have a column in my mysql table: zip char(6).
I know that I can map this field as a string, but I want to use simply char type.

Exception that I am getting when I try this:

SEVERE: IllegalArgumentException in class: prenumer.beans.Adres, setter method of property: kod
2009-09-29 12:54:50 org.hibernate.property.BasicPropertyAccessor$BasicSetter set
SEVERE: expected type: [C, actual value: java.lang.Character



sourcecode (I try to use 2 setters method):



mapping:

<property name="zip" type="character" length="6"/>



Could somebody give me advice?

Regards
Nothing still works
I'll try to do it once again without auto-generator.
Thank you again.
Thanks for advice, but it changes nothing. I am getting still the same exception without remove @Basic(optional = false).
However if I remove @Basic(optional = false) I have another exception:

Exception Description: [class projekttest.Klienci] uses a non-entity [class projekttest.Zamowienia] as target entity in the relationship attribute [private java.util.List projekttest.Klienci.zamowieniaList].



But I am sure that Zamowienia class is a entity, It was generated but netbeans and has a adnotation:

@Entity
@Table(name = "zamowienia")
Hello

I can't resolve this problem:

The type [interface java.util.List] for the attribute [zamowieniaList] on the entity class [class projekttest.Klienci] is not a valid type for a serialized mapping. The attribute type must implement the Serializable interface.




Adnotations:






Could anyone help me?

Regards