summaryrefslogtreecommitdiffstats
path: root/Master/Daten- und Systemintegration/Praktikum/DSI-Praktikum-1_ausgang/DSI1-ausgang/DSI-ejb/src/java/beans/lieferant/LieferantBean.java
blob: 2fb1a166de515e3b3ba561ef2e7c70cc454533f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beans.lieferant;

import beans.*;
import beans.lager.LagerRemote;
import beans.artikelManager.ArtikelManagerRemote;
import beans.adressen.AdressenRemote;
import exceptions.IllegalerWertException;
import exceptions.UnbekanntesEntityException;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author jmueller
 */
@Stateless(mappedName="LieferantBean")
public class LieferantBean implements LieferantRemote {
    @EJB
    private ArtikelManagerRemote artikelManagerBean;
    @EJB
    private LagerRemote lagerBean;
    @EJB
    private AdressenRemote adressenBean;

    
    
    /**
     * bestellt eine bestimmte Anzahl von Artikeln nach
     * @param id        die Id des Artikels
     * @param anzahl    die Anzahl
     */
    // TODO: Session Bean erstellen die die Adresse des Lieferanten für bestimmte 
    // Artikel heraussucht    
    public void bestelleNach(long id, long anzahl) throws  UnbekanntesEntityException, IllegalerWertException{
        System.out.println("Lieferant: bestelleNach("+id+","+anzahl+")");        
        lagerBean.bucheArtikelEin(id, anzahl);
        
        System.out.println("Bestellung erfolgt bei: " + adressenBean.getLieferantenAdresseFuerArtikel(id) );
    }
    
    
    
}