Subversion Repositories SmartDukaan

Rev

Rev 24658 | Rev 27878 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24658 Rev 25209
Line 139... Line 139...
139
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
139
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
140
	//@Fetch(value = FetchMode.SUBSELECT)
140
	//@Fetch(value = FetchMode.SUBSELECT)
141
	@JoinColumn(name="item_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
141
	@JoinColumn(name="item_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
142
	private Item item;
142
	private Item item;
143
	
143
	
-
 
144
	
-
 
145
	public String getItemDescription(){
-
 
146
		StringBuilder itemString = new StringBuilder();
-
 
147
		if(this.getBrand() != null && !this.getBrand().isEmpty()){
-
 
148
			itemString.append(this.getBrand().trim());
-
 
149
		}
-
 
150
		itemString.append(" ");
-
 
151
		if(this.getModelName() != null && !this.getModelName().isEmpty()){
-
 
152
			itemString.append(this.getModelName().trim());
-
 
153
		}
-
 
154
		if(this.getModelNumber() != null && !this.getModelNumber().isEmpty()){
-
 
155
			itemString.append(" ");
-
 
156
			itemString.append(this.getModelNumber().trim());
-
 
157
		}
-
 
158
		if(this.getColor() != null && !this.getColor().isEmpty() && !this.getColor().trim().equals("f_")){
-
 
159
			itemString.append(" ");
-
 
160
			itemString.append(this.getColor().trim());
-
 
161
		}
-
 
162
		return itemString.toString().replaceAll("\\s+", " ").trim();
-
 
163
	}
-
 
164
	
-
 
165
	public String getItemDescriptionNoColor(){
-
 
166
		StringBuilder itemString = new StringBuilder();
-
 
167
		if(this.getBrand() != null && !this.getBrand().isEmpty()){
-
 
168
			itemString.append(this.getBrand().trim());
-
 
169
		}
-
 
170
		itemString.append(" ");
-
 
171
		if(this.getModelName() != null && !this.getModelName().isEmpty()){
-
 
172
			itemString.append(this.getModelName().trim());
-
 
173
		}
-
 
174
		if(this.getModelNumber() != null && !this.getModelNumber().isEmpty()){
-
 
175
			itemString.append(" ");
-
 
176
			itemString.append(this.getModelNumber().trim());
-
 
177
		}
-
 
178
		
-
 
179
		return itemString.toString().replaceAll("\\s+", " ").trim();
-
 
180
	}
-
 
181
	
144
	public Integer getId() {
182
	public Integer getId() {
145
		return id;
183
		return id;
146
	}
184
	}
147
	public void setId(Integer id) {
185
	public void setId(Integer id) {
148
		this.id = id;
186
		this.id = id;