我知道这行不通,这让 IMO 很糟糕,但我想知道我最好的解决方案是什么。经过一番搜索,我发现了有关 ORM 和休眠的信息。在了解了它们之后,我发现很多人说它比它更值得,并促进了懒惰。请问有人能指点我一个好的方向吗?
//Setup the weapon classes
logger.info("Initializing the weapon classes.");
stat = conn.prepareStatement("SELECT *" +
" FROM " + DB_NAME + ".weapons");
rs = stat.executeQuery();
while (rs.next()) {
Weapon rs.getString("name") = new Weapon(rs.getint("weapon_id"), rs.getString("name"), rs.getString("description"), rs.getString("filename"), rs.getint("rarity"), rs.getint("sell_price"), rs.getint("quantity_max"), rs.getint("slot"), rs.getint("level_requirement"), rs.getint("strength_requirement"), rs.getint("dexterity_requirement"), rs.getint("intelligence_requirement"), rs.getint("enchanted_increase"), rs.getint("enchanted_cost"), rs.getint("hit_min"), rs.getint("hit_max"), rs.getint("speed"), rs.getint("elemental_type"), rs.getint("elemental_hit_min"), rs.getint("elemental_hit_max"));
}
我知道这已经被问过很多次了,但我只是发现了很多相互矛盾的意见。:(