Join two TableView in 1?

0

I present a form that is connected to 2 tables in the BD, my question is: can one form a single table ?, for the moment the form would handle it in two tables, different Code:

**@FXML
private TableView<Productos> **tblViewProductos**;
@FXML
private TableView<Precio> **tblViewPrecio**;**

@FXML
private ObservableList<Productos> listaProductos;
@FXML
private ObservableList<Precio> listaPrecio;

    @Override
public void initialize(URL location, ResourceBundle resources) {
    conexion = new Conexion();
    conexion.establecerConexion();
    listaProductos = FXCollections.observableArrayList();
    listaPrecio = FXCollections.observableArrayList();
    //Llenar informacion
    Productos.llenarInformacion(conexion.getConnection(), listaProductos);
    Precio.llenarInformacion(conexion.getConnection(), listaPrecio);
    tblViewProductos.setItems(listaProductos);
    tblViewPrecio.setItems(listaPrecio);
    //ENLAZAR COLUMMNAS Productos
    clmnIdProducto.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("idPro"));
    clmDescripcion.setCellValueFactory(new PropertyValueFactory<Productos, String>("descripcion"));
    clmstockMax.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("stockMax"));
    clmstockMin.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("stockMin"));
    clmCantidad.setCellValueFactory(new PropertyValueFactory<Productos, Integer>("cantidad"));
    //ENLAZAR COLUMMNAS Precio
    clmidPrecio.setCellValueFactory(new PropertyValueFactory<Precio, Integer>("idPre"));
    clmfechaInicio.setCellValueFactory(new PropertyValueFactory<Precio, Date>("fechaInicio"));
    clmfechaFin.setCellValueFactory(new PropertyValueFactory<Precio, Date>("fechaInicio"));
    clmValor.setCellValueFactory(new PropertyValueFactory<Precio, Double>("valor"));
    clmnIdPro.setCellValueFactory(new PropertyValueFactory<Precio, Integer>("idPro"));
    gestionarEvento();
    conexion.cerrarConexion();
}

This in the end generates a conflict, since a table or is "tblViewProducts" or "tblViewPrice"

    
asked by Jonathan E. Meriño Bolivar 22.06.2018 в 19:01
source

0 answers