Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Ich habe eine Tabelle mit Dokumenten, eine mit Ordnern und eine M:N Kreuztabelle dazwischen und möchte eine Liste eines einzigen DTO Types mit Informationen daraus erstellen.

Das Dto soll dann Informationen wie Name, Id, ParentFolerId und IsFolder (ob es ein Ordner oder ein Dokument ist) haben.

Bei folgendem Query


DtoFolderDocument dtoFolderDocument = null;
FolderToDocument folderToDocument = null;
FolderData folderData = null;
Document document;

var query = session.QueryOver<FolderData>(() => folderData)
.SelectList(list => list
.Select(fd => fd.FolderName).WithAlias(() => dtoFolderDocument.Name)
.Select(fd => fd.Id).WithAlias(() => dtoFolderDocument.Id)
.Select(fd => fd.ParentFolderId).WithAlias(() => dtoFolderDocument.ParentFolderId)
.Select(fd => true).WithAlias(() => dtoFolderDocument.IsFolder)
.SelectSubQuery(
session.QueryOver<Document>(()=>document)
.Where(d => d.MasterData.Id == masterDataId)
.JoinAlias(()=>document.FolderToDocuments, () => folderToDocument)
.Where(() => folderToDocument.FolderData.Id == folderData.Id)
.SelectList(list2 => list2
.Select(d => d.Name).WithAlias(() => dtoFolderDocument.Name)
.Select(d => d.Id).WithAlias(() => dtoFolderDocument.Id)
.Select(d => folderToDocument.FolderData.Id).WithAlias(() => dtoFolderDocument.ParentFolderId)
.Select(d => false).WithAlias(() => dtoFolderDocument.IsFolder))
.TransformUsing(Transformers.AliasToBean<DtoFolderDocument>())
).WithAlias(() => dtoFolderDocument.Childs))
.TransformUsing(Transformers.AliasToBean<DtoFolderDocument>())
.List<DtoFolderDocument>();[/PHP]

Meckert der Compiler beim SelectSubQuery das der Typ nicht anhand der Nutzung automatisch erkannt werden kann und ich ihn angeben soll.

Gebe ich hier zum Beispiel SelectSubQuery<DtoFolderDocument> an meckert er beim TransformUsing das er IQueryOver<Document,Document> nicht in QueryOver<DtoFolderDocument> konvertieren kann.

Ich hab schon viele verschiedene Kombinationen versucht aber es läuft immer wieder darauf hinaus das er QueryOver<T,T> nicht in QueryOver<T> konvertieren kann scheint mir, aber beim SelectSubQuery kann man nur einen Typ angeben und nicht SelectSubQuery<T,T>.

Ich bin da gerade ziemlich ratlos wie und hoffe hier kennt sich wer damit aus

Bearbeitet von Guybrush Threepwood

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.