[使用数据库的主要详细数据输入的Java形式

问题描述 投票:0回答:1

在java awt中,我想为oracle数据库中的主详细数据输入创建CRUD表单。 Gatepass主表和Gatepass详细信息表使用pk / fk关系连接到Gatepass编号上。这是门通票的形式。一张通行证会收到多个物品。格式类似于

Gatepass#1接收人:Tariq先生入场证日期:2019年3月21日

详细商品编号商品名称数量12把木椅413木桌1

任何人都可以提供一些示例代码。

java crud master-detail
1个回答
0
投票

如果您有10个以上的实体并使用Hibernate,则可以尝试我在以下位置托管的Desktop Java Forms:https://github.com/smart-flex/Djf

例如,这是来自演示应用程序的两个主从关系的简约定义:

<panel constraint="Center">
    <layout clazz="net.miginfocom.swing.MigLayout">
        <param type="string" value="" />
        <param type="string" value="[0:0, grow 70, fill][0:0, grow 30, fill]" />
        <param type="string" value="[c, pref, fill] 15 [c, 150px] 10 [c, pref!]" />
    </layout>
    <items>
        <grid bindPref="st">
            <cols>
                <int bind="idStreet" title="ID" width="50" enabled="no"
                    noResize="yes" />
                <text bind="streetName" title="Street name" />
            </cols>
        </grid>
        <grid constraint="wrap">
            <cols>
                <text bind="st.buildings.buildingNumber" title="Number" tips="Building number"/>
            </cols>
        </grid>
        <grid noInfoColumn="true" bindPref="ct">
            <cols>
                <int bind="carId" title="ID" width="50" enabled="no"
                    noResize="yes" />
                <text bind="carName" title="Car name" enabled="no" />
            </cols>
        </grid>
        <grid noInfoColumn="true" constraint="wrap">
            <cols>
                <text bind="ct.modelList.modelName" title="Model name" enabled="no" />
            </cols>
        </grid>     
        <oper constraint="span 2"/>
    </items>
</panel>
© www.soinside.com 2019 - 2024. All rights reserved.