ORMLite完全解析(一)通过实例理解使用流程

article/2025/10/29 11:31:42
在android中使用原始的SQLiteOpenHelper操作数据库显得过于繁琐,而且对于不是很熟悉数据库操作的人来说比较容易出现一些隐藏的漏洞。所以一般都会想到使用相关的ORMLite框架完成开发,类似于J2EE开发中的Hibernate和Mybatis等等,在提高开发效率的同时,也可以有效避免数据库操作对应用带来的潜在影响。
到现在为止,Android中ORM框架也已经有很多,比如ORMLite,Litepal,  androrm,SugarORM, GreenDAO,ActiveAndroid, Realm等等。对于他们之间的对比,可能各有长短,所谓存在即为合理。其中,ORMLite应该是使用较为广泛的一个,接下来我将通过几篇文章,结合ORMLIte的官方文档和源代码对这个框架进行分析。才疏学浅,如果有不足的地方,还请批评指正。
ORMLite官网:  http://ormlite.com/,下载jar包和实例。将jar包加入项目中。
第一篇,我先结合官方实例和自己的demo让大家感受一下ORMLite的魅力,并熟悉整个流程。
  尊重原创,转载请说明出处,谢谢! http://blog.csdn.net/oyangyujun

一、定义实体类
1. 注解属性和类名,对应数据库字段和表明。
2. 给定一个无参构造函数,以便查询返回实体对象。
@DatabaseTable(tableName = "person")
public class Person implements Serializable{private static final long serialVersionUID = 1L;@DatabaseField(generatedId = true)int id;@DatabaseField(canBeNull = true, defaultValue = "name")String name;@DatabaseField(canBeNull = true, defaultValue = "sex")String sex;@DatabaseField(canBeNull = true, defaultValue = "age")String age;@DatabaseField(canBeNull = true, defaultValue = "address")String address;@DatabaseField(canBeNull = true, defaultValue = "phone")String phone;@DatabaseField(canBeNull = true, defaultValue = "qq")String qq;@DatabaseField(canBeNull = true, defaultValue = "testField")String testField;@DatabaseField(canBeNull = true, defaultValue = "testField2")String testField2;public Person(){}

二、生成数据库配置文件
1.  先在res/raw下创建文件ormlite_config.txt
2.  继承OrmLiteCongifUtil类创建DatabaseConfigUtil工具了类,这个工具类用于生成数据库结构信息。
public class DatabaseConfigUtil extends OrmLiteConfigUtil {public static void main(String[] args) throws SQLException, IOException {writeConfigFile("ormlite_config.txt");}}
3.  在java本地环境下运行该类,不能直接运行android项目。本地环境配置的方法是,右键-》Run Configurations进入运行配置面板如下,注意看是否为当前项目的该工具类。

4.  选择JRE,选中Alternate JRE,指定使用的JRE版本,官方文档中说1.5或者1.6,当然,高版本也是可以的。
5.  选择Classpath,选中Bootstrap Entries下的android,remove掉。切记保留User Entries下的文件。否则会报NoClassDefFoundError, 这里其实就是取消android应用程序的入口,直接将上面的工具类作为程序入口。

6. 最后直接run,运行完成后会在ormlite_config.txt中生成下面的配置文件内容。

这个文件是数据库升级更新的依据。这样做的原因是,运行时注解是非常号资源的过程,程序运行时通过反射获取数据表结构维护数据库信息会严重影响效率,虽然OrmLite说明其注解比Java自身的注解机制速度提高了近20倍,不过还是推荐使用这种配置文件的方式。

三、创建数据库辅助类OrmLiteSqliteOpenHelper
1.  创建OrmLite数据库的方式和通过SqliteOpenHelper的维护数据库的方式基本相同,因为OrmLiteSqliteOpenHelper是SqliteOpenHelper的直接子类。我们在项目中使用时需要继承OrmLiteSqliteOpenHelper,重写onCreate和onUpgrade方法。不过OrmLiteSqliteOpenHelper类中这两个方法都比SqliteOpenHelper中多了一个ConnectionSource参数。从字面量理解这个参数主要是用于数据库的升级更新和创建DAO。注意,每次数据模型有变化是,都必须运行OrmLiteCongifUtil工具类更新配置文件和升级数据库版本号,并在onUpgrade中完成相关操作。
public class DatabaseHelper extends OrmLiteSqliteOpenHelper {// name of the database file for your application -- change to something appropriate for your appprivate static final String DATABASE_NAME = "helloAndroid.db";// any time you make changes to your database objects, you may have to increase the database versionprivate static final int DATABASE_VERSION = 3;// the DAO object we use to access the SimpleData tableprivate Dao<SimpleData, Integer> simpleDao = null;private RuntimeExceptionDao<SimpleData, Integer> simpleRuntimeDao = null;public DatabaseHelper(Context context) {super(context, DATABASE_NAME, null, DATABASE_VERSION, R.raw.ormlite_config);}/*** This is called when the database is first created. Usually you should call createTable statements here to create* the tables that will store your data.*/@Overridepublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {try {Log.i(DatabaseHelper.class.getName(), "onCreate");TableUtils.createTable(connectionSource, SimpleData.class);} catch (SQLException e) {Log.e(DatabaseHelper.class.getName(), "Can't create database", e);throw new RuntimeException(e);}// here we try inserting data in the on-create as a testRuntimeExceptionDao<SimpleData, Integer> dao = getSimpleDataDao();long millis = System.currentTimeMillis();// create some entries in the onCreateSimpleData simple = new SimpleData(millis);dao.create(simple);simple = new SimpleData(millis + 1);dao.create(simple);Log.i(DatabaseHelper.class.getName(), "created new entries in onCreate: " + millis);}/*** This is called when your application is upgraded and it has a higher version number. This allows you to adjust* the various data to match the new version number.*/@Overridepublic void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) {try {Log.i(DatabaseHelper.class.getName(), "onUpgrade");TableUtils.dropTable(connectionSource, SimpleData.class, true);// after we drop the old databases, we create the new onesonCreate(db, connectionSource);} catch (SQLException e) {Log.e(DatabaseHelper.class.getName(), "Can't drop databases", e);throw new RuntimeException(e);}}/*** Returns the Database Access Object (DAO) for our SimpleData class. It will create it or just give the cached* value.*/public Dao<SimpleData, Integer> getDao() throws SQLException {if (simpleDao == null) {simpleDao = getDao(SimpleData.class);}return simpleDao;}/*** Returns the RuntimeExceptionDao (Database Access Object) version of a Dao for our SimpleData class. It will* create it or just give the cached value. RuntimeExceptionDao only through RuntimeExceptions.*/public RuntimeExceptionDao<SimpleData, Integer> getSimpleDataDao() {if (simpleRuntimeDao == null) {simpleRuntimeDao = getRuntimeExceptionDao(SimpleData.class);}return simpleRuntimeDao;}/*** Close the database connections and clear any cached DAOs.*/@Overridepublic void close() {super.close();simpleDao = null;simpleRuntimeDao = null;}
}
表升级对数据库数据的影响怎么解决?目前是什么情况?

四、获得DAO对象
获得DAO的方式有两种。
1.   通过OrmLiteSqliteOpenHelper暴露接口获得,OrmLiteSqliteOpenHelper中默认封装了getDao(Class<T> clazz)方法和getRuntimeExceptionDao(Class<T> clazz)方法便于获得DAO对象。这两个方法本质上是一样的都是通过DAOManage获得对应的DAO对象:
        /*** Get a DAO for our class. This uses the {@link DaoManager} to cache the DAO for future gets.* * <p>* NOTE: This routing does not return Dao<T, ID> because of casting issues if we are assigning it to a custom DAO.* Grumble.* </p>*/public <D extends Dao<T, ?>, T> D getDao(Class<T> clazz) throws SQLException {// special reflection fu is now handled internally by create dao calling the database typeDao<T, ?> dao = DaoManager.createDao(getConnectionSource(), clazz);@SuppressWarnings("unchecked")D castDao = (D) dao;return castDao;}/*** Get a RuntimeExceptionDao for our class. This uses the {@link DaoManager} to cache the DAO for future gets.* * <p>* NOTE: This routing does not return RuntimeExceptionDao<T, ID> because of casting issues if we are assigning it to* a custom DAO. Grumble.* </p>*/public <D extends RuntimeExceptionDao<T, ?>, T> D getRuntimeExceptionDao(Class<T> clazz) {try {Dao<T, ?> dao = getDao(clazz);@SuppressWarnings({ "unchecked", "rawtypes" })D castDao = (D) new RuntimeExceptionDao(dao);return castDao;} catch (SQLException e) {throw new RuntimeException("Could not create RuntimeExcepitionDao for class " + clazz, e);}}

他们的区别在于对处理异常的方式不一样。如RuntimeExceptionDao的类注释所述,RuntimeExceptionDao只是对异常信息进行了包装处理,并将其作为运行时异常重新抛出。
/*** Proxy to a {@link Dao} that wraps each Exception and rethrows it as RuntimeException. You can use this if your usage* pattern is to ignore all exceptions. That's not a pattern that I like so it's not the default.* * <p>* * <pre>* RuntimeExceptionDao<Account, String> accountDao = RuntimeExceptionDao.createDao(connectionSource, Account.class);* </pre>* * </p>* * @author graywatson*/
public class RuntimeExceptionDao<T, ID> implements CloseableIterable<T> {

如果我们应用中的组件是通过继承OrmLiteBaseActivity等类的方式来使用ORMLite的话,可以使用派生出来的组件已有的getHelper()方法直接获得OrmLiteSqliteOpenHelper对象,然后调用我们在OrmLiteSqliteOpenHelper中暴露的接口获取对应的DAO对象。如下:
RuntimeExceptionDao<SimpleData, Integer> simpleDao = getHelper().getSimpleDataDao();

2.  第二种获得DAO的方式是直接通过DAOManager获得。使用这种方式需要一个ConnectionSource参数,和实体类的Class对象,ConnectionSource参数可以通过OrmLiteSqliteOpenHelper的getConnectionSource()方法获得。这两个方法定义如下。
DAOManager中的createDAO方法。
        /*** Helper method to create a DAO object without having to define a class. This checks to see if the DAO has already* been created. If not then it is a call through to {@link BaseDaoImpl#createDao(ConnectionSource, Class)}.*/public synchronized static <D extends Dao<T, ?>, T> D createDao(ConnectionSource connectionSource, Class<T> clazz)throws SQLException {
OrmLiteSqliteOpenHelper中的getConnectionSource方法。
        protected AndroidConnectionSource connectionSource = new AndroidConnectionSource(this);/*** Get the connection source associated with the helper.*/public ConnectionSource getConnectionSource() {if (!isOpen) {// we don't throw this exception, but log it for debugging purposeslogger.warn(new IllegalStateException(), "Getting connectionSource was called after closed");}return connectionSource;}

五、在Activity中使用DAO操作数据库。
1.  获得Helper对象
通过上面的分析可知,DAO可以通过Helper对象获得,也建议使用这种方式。而且使用DAO操作数据库才是我们的想要的过程,对于这一点,ORMLite本身也考虑的非常周到,他给我们提供了一些相应的快捷实现类,包括OrmLiteBaseActivity, OrmLiteBaseActivityGroup, OrmLiteBaseListActivity, OrmLiteBaseService, OrmLiteBaseTabActivity等。仔细分析其源码,发现 实现方式都是一样的,这里以OrmLiteBaseActivity为例。完整源代码如下:
/*** Base class to use for activities in Android.* * You can simply call {@link #getHelper()} to get your helper class, or {@link #getConnectionSource()} to get a* {@link ConnectionSource}.* * The method {@link #getHelper()} assumes you are using the default helper factory -- see {@link OpenHelperManager}. If* not, you'll need to provide your own helper instances which will need to implement a reference counting scheme. This* method will only be called if you use the database, and only called once for this activity's life-cycle. 'close' will* also be called once for each call to createInstance.* * @author graywatson, kevingalligan*/
public abstract class OrmLiteBaseActivity<H extends OrmLiteSqliteOpenHelper> extends Activity {private volatile H helper;private volatile boolean created = false;private volatile boolean destroyed = false;private static Logger logger = LoggerFactory.getLogger(OrmLiteBaseActivity.class);/*** Get a helper for this action.*/public H getHelper() {if (helper == null) {if (!created) {throw new IllegalStateException("A call has not been made to onCreate() yet so the helper is null");} else if (destroyed) {throw new IllegalStateException("A call to onDestroy has already been made and the helper cannot be used after that point");} else {throw new IllegalStateException("Helper is null for some unknown reason");}} else {return helper;}}/*** Get a connection source for this action.*/public ConnectionSource getConnectionSource() {return getHelper().getConnectionSource();}@Overrideprotected void onCreate(Bundle savedInstanceState) {if (helper == null) {helper = getHelperInternal(this);created = true;}super.onCreate(savedInstanceState);}@Overrideprotected void onDestroy() {super.onDestroy();releaseHelper(helper);destroyed = true;}/*** This is called internally by the class to populate the helper object instance. This should not be called directly* by client code unless you know what you are doing. Use {@link #getHelper()} to get a helper instance. If you are* managing your own helper creation, override this method to supply this activity with a helper instance.* * <p>* <b> NOTE: </b> If you override this method, you most likely will need to override the* {@link #releaseHelper(OrmLiteSqliteOpenHelper)} method as well.* </p>*/protected H getHelperInternal(Context context) {@SuppressWarnings({ "unchecked", "deprecation" })H newHelper = (H) OpenHelperManager.getHelper(context);logger.trace("{}: got new helper {} from OpenHelperManager", this, newHelper);return newHelper;}/*** Release the helper instance created in {@link #getHelperInternal(Context)}. You most likely will not need to call* this directly since {@link #onDestroy()} does it for you.* * <p>* <b> NOTE: </b> If you override this method, you most likely will need to override the* {@link #getHelperInternal(Context)} method as well.* </p>*/protected void releaseHelper(H helper) {OpenHelperManager.releaseHelper();logger.trace("{}: helper {} was released, set to null", this, helper);this.helper = null;}@Overridepublic String toString() {return getClass().getSimpleName() + "@" + Integer.toHexString(super.hashCode());}
}

通过源码可以知道,这些扩展类,都是内部持有了一个对应的OrmLiteSqliteOpenHelper对象。并在Activity的onCreate方法中初始化,在onDestroyed方法中销毁释放资源。
这里涉及到一个OpenHelperManager类,这个类是 OrmLiteSqliteOpenHelper的工具类,用于管理数据库连接。完整的解释如下:
/*** This helps organize and access database connections to optimize connection sharing. There are several schemes to* manage the database connections in an Android app, but as an app gets more complicated, there are many potential* places where database locks can occur. This class allows database connection sharing between multiple threads in a* single app.* * This gets injected or called with the {@link OrmLiteSqliteOpenHelper} class that is used to manage the database* connection. The helper instance will be kept in a static field and only released once its internal usage count goes* to 0.* * The {@link SQLiteOpenHelper} and database classes maintain one connection under the hood, and prevent locks in the* java code. Creating multiple connections can potentially be a source of trouble. This class shares the same* connection instance between multiple clients, which will allow multiple activities and services to run at the same* time.* * Every time you use the helper, you should call {@link #getHelper(Context)} or {@link #getHelper(Context, Class)}.* When you are done with the helper you should call {@link #releaseHelper()}.* * @author graywatson, kevingalligan*/
public class OpenHelperManager {
翻译:这个类用于组织和获取数据库连接,优化连接共享。在一个app中,可能有多个模式来管理数据库连接,但是当app变得愈加复杂时,就会存在很多潜在的数据库锁发生点。这个类允许数据库连接在同一app的多个线程中共享。
       这个用于注入OrmLiteSqliteOpenHelper,之后,OrmLiteSqliteOpenHelper的实例会作为一个静态属性被持有。只有当其内部的使用数变为0时才会被释放。
       SQLiteOpenHelper和数据库类在这个引擎下持有一个连接,并且防止java代码中发生死锁。创建多个连接可能会存在潜在的安全问题。这个类在多个客户端中持有相同的连接实例, 并允许多个Activity和service在同一时刻运行。
每次使用这个Helper是,你应该调用getHelper(Context)或者getHelper(Context,Class),操作完成时,应该调用releaseHelper()进行释放。
       处理上面的解释外,可以注意到,OrmLiteBaseActivity中的OrmLiteSqliteOpenHelper对象被修饰为volatile。这个修 饰符的作用是修饰被不同线程访问和修改的变量。如果没有volatile,基本上会导致这样的结果:要么无法编写多线程程序,要么编译器失去大量优化的机会。

        同时也可以想到,如果我们不想让自己的Activity继承OrmLite中的基类,大可按照其内部实现方式,将写代码迁移到我们自己的BaseActivity中。

2.  通过Helper获得的DAO对象操作数据库
到此为止,我们知道了怎么获得Helper并通过Helper获得DAO,或者RuntimeExceptionDao,下面是对数据库进行操作的基本方式。
官方的HelloAndroid中使用到了三种基本操作,插入,查询,删除。
方式如下: 插入数据的代码在Helper类的onCreate中,当然在其他地方是毫无疑问的可以的。创建对象,给对象赋值,然后直接通过DAO进行create即可(看上面 Helper类的实现)。
其次是查询,官方实例中查询和删除在HelloAndroid中进行的,都是直接通过Dao的实例调用响应的方法:
                // get our daoRuntimeExceptionDao<SimpleData, Integer> simpleDao = getHelper().getSimpleDataDao();// query for all of the data objects in the databaseList<SimpleData> list = simpleDao.queryForAll();// our string builder for building the content-viewStringBuilder sb = new StringBuilder();sb.append("got ").append(list.size()).append(" entries in ").append(action).append("\n");// if we already have items in the databaseint simpleC = 0;for (SimpleData simple : list) {sb.append("------------------------------------------\n");sb.append("[").append(simpleC).append("] = ").append(simple).append("\n");simpleC++;}sb.append("------------------------------------------\n");for (SimpleData simple : list) {simpleDao.delete(simple);sb.append("deleted id ").append(simple.id).append("\n");Log.i(LOG_TAG, "deleting simple(" + simple.id + ")");simpleC++;}
当然快捷操作方法还有很多,使用方式都是类似的,后面再分析。

http://chatgpt.dhexx.cn/article/VI93Pu8y.shtml

相关文章

Android数据库ORMlite框架

前言 由于第二章是整个文档的核心&#xff0c;内容也很多&#xff0c;所以分次翻译。下一章的内容会继续本章接着翻译。 ------------------------------------------------------------------------------------- 2 如何使用 这一章进入到更多详细地使用ORMLite的各种功能。 2…

Ormlite 介绍 一

概述 ORMlite是类似hibernate的对象映射框架,主要面向java语言,同时,是时下最流行的android面向数据库的的编程工具。 官方网站:http://ormlite.com/ 如果需要开发android,只需要下载core和android两个jar包: ORMlite的使用 1,建立映射关系 Ormlite与数据库…

ormlite介绍一

概述 ORMlite是类似hibernate的对象映射框架&#xff0c;主要面向java语言&#xff0c;同时&#xff0c;是时下最流行的android面向数据库的的编程工具。 官方网站&#xff1a;http://ormlite.com/ 如果需要开发android&#xff0c;只需要下载core和android两个jar包&#xff…

Lite-Orm数据库

1. 初步认识 GItHub库 自动化且比系统自带数据库操作快1倍&#xff01; LiteOrm是android上的一款数据库&#xff08;ORM&#xff09;框架库。速度快、体积小、性能高。开发者基本一行代码实现数据库的增删改查操作&#xff0c;以及实体关系的持久化和自动映射。 2.导入orm相…

Android 数据库框架ormlite 使用精要

Android 数据库框架ormlite 使用精要 前言 本篇博客记录一下笔者在实际开发中使用到的一个数据库框架&#xff0c;这个可以让我们快速实现数据库操作&#xff0c;避免频繁手写sql&#xff0c;提高我们的开发效率&#xff0c;减少出错的机率。 ormlite是什么&#xff1f; 首…

ormlite 的简单应用

在android开发中还有哪些技术可以方便的操作数据库&#xff0c;我不大清楚&#xff0c;今天学习了一下 ormlite&#xff0c;觉得还不错&#xff0c;非常方便。 ormlite官网下载&#xff1a;http://ormlite.com/releases/ 1、引入jar包 2、写实体类 package com.example.aandr…

OrmLite for android--Ormlite的大概介绍

Ormlite 是一种ORM工具&#xff0c;并且是一种轻量级别的工具。我们可以使用它来对Android中内嵌的sqlite数据库进行相关的操作。Android 的应用程序应使用 Ormlite for android 版本来进行相关的开发。Ormlite for android 提供两个jar库&#xff1a;ormlite-android-4.22.j…

Ormlite 介绍 一

概述 ORMlite是类似hibernate的对象映射框架&#xff0c;主要面向java语言&#xff0c;同时&#xff0c;是时下最流行的android面向数据库的的编程工具。 官方网站&#xff1a;http://ormlite.com/ 如果需要开发android&#xff0c;只需要下载core和android两个jar包&#xff…

Ormlite基本使用

首先需要导入ORMLite的依赖&#xff1a;在build.gradle中加入以下代码&#xff1a; implementation com.j256.ormlite:ormlite-android:5.1implementation com.j256.ormlite:ormlite-core:5.1建立Bean类&#xff08;以OneTableBean为例&#xff09; import com.j256.ormlite.f…

Android 数据库框架ormlite 使用

ormlite是什么&#xff1f; 首先可以去它的官网看看www.ormlite.com&#xff0c;它的英文全称是Object Relational Mapping&#xff0c;意思是对象关系映射&#xff1b;如果接触过Java EE开发的&#xff0c;一定知道Java Web开发就有一个类似的数据库映射框架——Hibernate。简…

Android ORMLite数据库简介

&#xfeff;&#xfeff; 一般的项目中&#xff0c;Android自身提供的SQLite数据库&#xff0c;可以满足轻量级的数据存储应用&#xff0c;但是&#xff0c;只要是存储模型稍微复杂的项目&#xff0c;以及数据结构模型复杂的应用&#xff0c;就很难再用SQLite支撑整个项目的数…

python的网络请求库urllib、urllib2、urllib3、request的联系

文章目录 1. 简介2. urllib3. urllib24. urllib35. requests6. 相关文章 1. 简介 urllib、urllib2、urllib3、request均能通过网络访问互联网上的资源文件&#xff0c;它们通过使用统一资源定位符&#xff08;URL&#xff09;并结合re模块完成很多意想不到的操作。 urllib&am…

python3安装urllib2_python3.6想使用urllib2包怎么办

Python3.6.6或者说python3.x找不到urllib2语法问题修改之后&#xff0c;会报一个没有安装urllib2的包的错误。 通过pip install urllib2也会提示找不到包。(推荐学习&#xff1a;Python视频教程) 通过pip3 install urllib2也会提示找不到包。 这是因为builtwith依赖于urllib2包…

pythonurllib2方法_解决python3.6想使用urllib2包的方法

解决python3.6想使用urllib2包的方法 发布时间&#xff1a;2020-08-11 14:24:50 来源&#xff1a;亿速云 阅读&#xff1a;131 作者&#xff1a;小新 小编给大家分享一下解决python3.6想使用urllib2包的方法&#xff0c;相信大部分人都还不怎么了解&#xff0c;因此分享这篇文章…

python安装urllib2_Python如何安装urllib2库

urllib2 是 Python2.7 自带的模块(不需要下载,导入即可使用)。 urllib2库的基本使用 所谓网页抓取,就是把URL地址中指定的网络资源从网络流中读取出来,保存到本地。 在Python中有很多库可以用来抓取网页,我们先学习urllib2。urllib2 是 Python2.7 自带的模块(不需要下载,…

python爬虫-urllib2的使用方法详解(python3)

文章目录 python编程快速上手&#xff08;持续更新中…&#xff09;python爬虫从入门到精通urllib2概述python2与python3对比urlopenRequestUser-Agent添加更多的Header信息 urllib2默认只支持HTTP/HTTPS的GET和POST方法URL编码转换&#xff1a;urllib.parse.urlencode模拟百度…

Urllib2库丨Python爬虫基础入门系列(12)

提示&#xff1a;文末有福利&#xff01;最新Python爬虫资料/学习指南>>戳我直达 文章目录 前言Urllib2库学习目的urlopenGET请求方式利用urllib2.Request类,添加Header信息POST请求方式抓取招聘信息思考一下 小结 总结 前言 Urllib2库 urllib2是python2.7自带的模块(不…

Hyper-V虚拟化

第一章 Hyper-V 介绍 1-1 Hyper-V发展历史 2003 年&#xff0c;微软收购了一家虚拟化软件公司。2004 年推出了第一个桌面虚拟化产品Virtual PC 2004&#xff0c;其功能类似于VMware 工作站(work station)。由于该虚拟化产品集成在操作系统之中&#xff0c;所以用户可以在windo…

QNX Hypervisor管理程序

QNX Hypervisor管理程序 借助 QNX 管理程序&#xff0c;可以将具有不同操作系统&#xff0c;不同可靠性和安全要求的多个嵌入式系统&#xff0c;整合到单个片上系统 (SoC) 中。可以轻松地将未修改的代码移动到最新的硬件上&#xff0c;只需在适当配置的hypervisor 管理程序虚拟…

怎么开启windows hypervisor platform,解决hypervisor platform消失无法安装的问题

正常的windows功能面板 我的 很好,没有安装windows hypervisor platform的机会,但是没关系(ps:此处描述有误中文名称应该是虚拟机监控程序平台) 然后cmd 或powershll 管理员身份运行 Dism /online /Get-Features 可以查看到hypervisor platform是禁用状态 ::%cd%代表的是执…