我正在使用 WOLips 和 Eclipse,我正在开发一个项目,我只需要了解其他项目中的一些实体,但我不想引用它(构建路径)。
我需要执行一条sql语句,看看这个表的某些记录是否存在,不再存在。
我正在尝试使用 EOUtilities 和框架的其他类,但我找不到办法。
请原谅我的英语。
任何帮助将不胜感激。
我正在使用 WOLips 和 Eclipse,我正在开发一个项目,我只需要了解其他项目中的一些实体,但我不想引用它(构建路径)。
我需要执行一条sql语句,看看这个表的某些记录是否存在,不再存在。
我正在尝试使用 EOUtilities 和框架的其他类,但我找不到办法。
请原谅我的英语。
任何帮助将不胜感激。
You can get information about any table in the database, even if it does not appear in your model. The only reason you need the model is that one needs the connection dictionary in order to connect to the database. But you could have 0 entities in your EOModel and it will still work.
You just need to provide the SQL. For example, with MySQL, one uses "desc tables". For Oracle, one needs to use the longer command that I always have to look up that does the same thing. Then look at the resulting array of dictionaries. The table name will be tied to some key, depending on the database and version of the database and/or JDBC drives, but the table name will be there. For MySQL, the key is either "FIELD" or "NAME", I think.
我想你可以使用EOUtilities.rawRowsForSQL()。您需要一个模型名称,但可能您已经拥有了——您不需要从您尝试执行此操作的位置引用模型的包含项目。