Ticket #825 (reopened defect)

Opened 18 months ago

Last modified 8 months ago

QueryContainer doesn't allow closing without losing container data.

Reported by: Mauno Haukila Owned by: Jani Laakso
Priority: minor Milestone: IT Mill Sponsored Backlog
Component: undefined Version:
Keywords: Cc:
Known Issue description:
Hours estimate: Deadline (dd.mm.yyyy):
Known Issue version (since): Known Issue title:
Hours done: Depends to:
Affects documentation: no
Known Issue workaround:
Affects release notes: yes Contract:

Description

Created QueryContainer? for database table that has two rows (SELECT * FROM table). If I set that QueryContainer? to Table's containerDataSource it shows all headers ok but it shows those two rows with empty values (see attached picture).

Attachments

tablebug.png (3.6 kB) - added by Mauno Haukila 18 months ago.

Change History

Changed 18 months ago by Mauno Haukila

Changed 18 months ago by Mauno Haukila

  • summary changed from Table doesn't work with QueryContainer to QueryContainer doesn't allow closing without losing container data.

Changed this bug description and and topic. Problem isn't in table, it is in QueryContainer?. QueryContainer? doesn't contain any values if it's closed. This is unwanted behavior because without closing queries cursors to database are left open.

Changed 18 months ago by Jani Laakso

  • status changed from new to closed
  • resolution set to wontfix

Copy QueryContainer? items to new container called IndexedContainer, close QueryContainer? and use IndexedContainer instead. Here's an example:

try {
			QueryContainer qc = new QueryContainer("SELECT * FROM employee",
					sampleDatabase.getConnection());
			IndexedContainer ic = new IndexedContainer(qc.getItemIds());
			qc.close();
			table.setContainerDataSource(ic);
		} catch (SQLException e) {
			e.printStackTrace();
		}

Changed 18 months ago by Jani Laakso

  • status changed from closed to reopened
  • resolution deleted

Note from Mauno, you need to copy items and properties aswell, above example copies only ids. Re-opening this ticket.

Changed 18 months ago by Jani Laakso

Suggest you add helper method directly to QueryContainer? which copies QueryContainer? resultset into IndexedContainer using 3 for loops.

Changed 12 months ago by Joonas Lehtinen

  • milestone set to User Interface Library 5.1.0 RC

Changed 12 months ago by Jani Laakso

Lots of methods should throw "not implemented", QC needs major rework. For example, when you read data from database table, you may then edit Container (POJO) items but this is not wise move because there is no way to commit POJO Container changes back to database. At this point user notices that I got to do all this manually..

Perhaps we should consider moving QueryContainer? more like SQLContainer (invented in Testing Tools), it's a lot simpler "read only from SQL table" Container. All item additions / updates are done always directly to SQL table and then SQLContainer simply refreshes itself.

Changed 10 months ago by Jani Laakso

  • milestone changed from User Interface Library 5.1.2 to Sprint 4 backlog

Changed 10 months ago by Joonas Lehtinen

  • milestone changed from Sprint 4 backlog to User Interface Library 5.1.2

Milestone Sprint 4 backlog deleted

Changed 10 months ago by Jani Laakso

  • priority changed from undefined to minor
  • version deleted

Changed 9 months ago by Joonas Lehtinen

  • milestone changed from User Interface Library 5.1.2 to User Interface Library 5.2.0

Milestone User Interface Library 5.1.2 deleted

Changed 8 months ago by Matti Tahvonen

  • milestone deleted

Changed 8 months ago by Joonas Lehtinen

  • milestone set to IT Mill Sponsored Backlog
Note: See TracTickets for help on using tickets.