You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Björn K <bj...@hcbmedia.nl> on 2009/02/18 10:11:35 UTC

Geronimo & MySQL & Column types

recently installed geronimo.

my situation is the following:

MySQL 5.1.31
Geronimo 2.1

an single entity on a existing table and im getting some unexplainable
warnings. I changed the length value of the @Column annotation to match the
table structure. now it gives me warnings that the definition is incorrect.
can anyone tell me whats wrong or why this is happening?

table structure:

CREATE TABLE  `user_additional` (
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `gender` enum('male','female') COLLATE utf8_unicode_ci DEFAULT NULL,
  `first_name` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `surname` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `street` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `number` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
  `extension` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(6) COLLATE utf8_unicode_ci DEFAULT NULL,
  `city` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `province_id` mediumint(8) DEFAULT NULL,
  `tel` int(10) unsigned zerofill DEFAULT NULL,
  `education_id` mediumint(3) unsigned DEFAULT NULL,
  `zip_check` enum('good','suspicious','fault','error') COLLATE
utf8_unicode_ci DEFAULT 'error',
  `birthday` date DEFAULT NULL,
  `holiday_depart` date DEFAULT NULL,
  `holiday_arrival` date DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Entity class:

@Entity
@Table(name = "USER_ADDITIONAL")
public class MomiUser extends MomiUserManager implements Serializable {
	public enum Gender {
		male,
		female
	}
	
	@Id
	@Column(updatable=false)
	private int user_id;
	
	@Column(updatable=false)
	@Enumerated(EnumType.STRING)
	private Gender gender;
	
	@Column(updatable=false, length=30)
	private String first_name;
	
	@Column(updatable=false, length=30)
	private String surname;
	
	@Column(updatable=false, length=100)
	private String street;
	
	@Column(updatable=false, length=40)
	private String number;
	
	@Column(updatable=false, length=25)
	private String extension;
	
	@Column(updatable=false, length=6)
	private String zip;
	
	@Column(updatable=false, length=25)
	private String city;
	
	@Column(updatable=false)
	private int province_id;
	
	@Column(updatable=false)
	private int tel;
	
	@Column(updatable=false)
	private int education_id;
	
	@Column(updatable=false)
	private Date birthday;
	
	@Column(updatable=false)
	private Date holiday_depart;
	
	@Column(updatable=false)
	private Date holiday_arrival;
	
	public MomiUser(){super();}

	public int getUser_id() {
		return user_id;
	}

	public void setUser_id(int user_id) {
		this.user_id = user_id;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getFirst_name() {
		return first_name;
	}

	public void setFirst_name(String first_name) {
		this.first_name = first_name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getExtension() {
		return extension;
	}

	public void setExtension(String extension) {
		this.extension = extension;
	}

	public String getZip() {
		return zip;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public int getProvince_id() {
		return province_id;
	}

	public void setProvince_id(int province_id) {
		this.province_id = province_id;
	}

	public int getTel() {
		return tel;
	}

	public void setTel(int tel) {
		this.tel = tel;
	}

	public int getEducation_id() {
		return education_id;
	}

	public void setEducation_id(int education_id) {
		this.education_id = education_id;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Date getHoliday_depart() {
		return holiday_depart;
	}

	public void setHoliday_depart(Date holiday_depart) {
		this.holiday_depart = holiday_depart;
	}

	public Date getHoliday_arrival() {
		return holiday_arrival;
	}

	public void setHoliday_arrival(Date holiday_arrival) {
		this.holiday_arrival = holiday_arrival;
	}
}

Warning messages:

10:08:21,984 WARN  [Schema] Existing column "CITY" on table
"SYSTEM.USER_ADDITIONAL" is incompatible with the same column in the given
schema definition. Existing column:
Full Name: USER_ADDITIONAL.CITY
Type: varchar
Size: 255
Default: null
Not Null: false
Given column:
Full Name: USER_ADDITIONAL.city
Type: varchar
Size: 25
Default: null
Not Null: false

10:08:21,984 WARN  [Schema] Existing column "EXTENSION" on table
"SYSTEM.USER_ADDITIONAL" is incompatible with the same column in the given
schema definition. Existing column:
Full Name: USER_ADDITIONAL.EXTENSION
Type: varchar
Size: 255
Default: null
Not Null: false
Given column:
Full Name: USER_ADDITIONAL.extension
Type: varchar
Size: 25
Default: null
Not Null: false

10:08:21,984 WARN  [Schema] Existing column "FIRST_NAME" on table
"SYSTEM.USER_ADDITIONAL" is incompatible with the same column in the given
schema definition. Existing column:
Full Name: USER_ADDITIONAL.FIRST_NAME
Type: varchar
Size: 255
Default: null
Not Null: false
Given column:
Full Name: USER_ADDITIONAL.first_name
Type: varchar
Size: 30
Default: null
Not Null: false

10:08:21,984 WARN  [Schema] Existing column "NUMBER" on table
"SYSTEM.USER_ADDITIONAL" is incompatible with the same column in the given
schema definition. Existing column:
Full Name: USER_ADDITIONAL.NUMBER
Type: varchar
Size: 255
Default: null
Not Null: false
Given column:
Full Name: USER_ADDITIONAL.number
Type: varchar
Size: 40
Default: null
Not Null: false

10:08:21,984 WARN  [Schema] Existing column "STREET" on table
"SYSTEM.USER_ADDITIONAL" is incompatible with the same column in the given
schema definition. Existing column:
Full Name: USER_ADDITIONAL.STREET
Type: varchar
Size: 255
Default: null
Not Null: false
Given column:
Full Name: USER_ADDITIONAL.street
Type: varchar
Size: 100
Default: null
Not Null: false

10:08:21,984 WARN  [Schema] Existing column "SURNAME" on table
"SYSTEM.USER_ADDITIONAL" is incompatible with the same column in the given
schema definition. Existing column:
Full Name: USER_ADDITIONAL.SURNAME
Type: varchar
Size: 255
Default: null
Not Null: false
Given column:
Full Name: USER_ADDITIONAL.surname
Type: varchar
Size: 30
Default: null
Not Null: false

10:08:21,984 WARN  [Schema] Existing column "ZIP" on table
"SYSTEM.USER_ADDITIONAL" is incompatible with the same column in the given
schema definition. Existing column:
Full Name: USER_ADDITIONAL.ZIP
Type: varchar
Size: 255
Default: null
Not Null: false
Given column:
Full Name: USER_ADDITIONAL.zip
Type: varchar
Size: 6
Default: null
Not Null: false
-- 
View this message in context: http://www.nabble.com/Geronimo---MySQL---Column-types-tp22074895s134p22074895.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Geronimo & MySQL & Column types

Posted by Björn K <bj...@hcbmedia.nl>.
fixed it myself...

since i only need to read values from the table i changed tehe column
annotation to

@Column(insertable=false, updatable=false)

not being able to insert or update must switch the column type check off :)

-- 
View this message in context: http://www.nabble.com/Geronimo---MySQL---Column-types-tp22074895s134p22077755.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.