当前位置: 首页 > news >正文

济南网站建设模板免费域名解析

济南网站建设模板,免费域名解析,企业网站优化分为哪两个方向,土特产 网站源码介绍 本文介绍如何在Openxava应用程序上快速启用Ehcache#xff0c;从而提高性能。 查看实体及其图时#xff0c;将加载关系。 添加第二级缓存可加快关联元素的检索速度#xff0c;因为已加载的元素是从缓存而不是数据库中检索的。 最终#xff0c;该页面解释了分钟项目如… 介绍 本文介绍如何在Openxava应用程序上快速启用Ehcache从而提高性能。 查看实体及其图时将加载关系。 添加第二级缓存可加快关联元素的检索速度因为已加载的元素是从缓存而不是数据库中检索的。 最终该页面解释了分钟项目如何遵守诺言不写任何内容。 例如我们将以Lazuly分钟项目展示为例。 Openxava-Ehcache集成 在Openxava中您可以使用Java注释的POJO来描述模型。注释来自标准的JPA2 ORM和特定于Openxava的注释。 但是没有什么可以阻止您添加其他人。 完成添加缓存的操作。 还有一些配置可以启用缓存。 行动清单 在源的根目录添加ehcache.xml配置文件 修改persistence.xml以包括二级缓存 添加缓存注释与JPA2一起 备注 Openxava带有ehcache.jar因此无需添加依赖项。 详细动作 添加ehcache.xml 在/ persistence处的ehcache.xml文件中 ehcachedefaultCachemaxElementsInMemory1000eternalfalsetimeToIdleSeconds300timeToLiveSeconds300overflowToDiskfalsediskPersistentfalsediskExpiryThreadIntervalSeconds300memoryStoreEvictionPolicyLRU/cachenameyour.domain.objectmaxElementsInMemory5000eternalfalsetimeToIdleSeconds300timeToLiveSeconds600overflowToDiskfalse/ /ehcache 修改persistence.xml Persistence.xml文件包含与永久单元有关的信息例如连接池信息 类或配置加载。 persistence.xml位于/ persistence / META-INF中 我们将附加L2缓存的属性。 propertiesproperty namehibernate.dialect valueorg.hibernate.dialect.MySQLDialect/property namehibernate.cache.provider_class valuenet.sf.ehcache.hibernate.SingletonEhCacheProvider /property namenet.sf.ehcache.configurationResourceName value/ehcache.xml /property namehibernate.cache.use_query_cache valuetrue /property namehibernate.cache.use_second_level_cache valuetrue /property namehibernate.generate_statistics valuetrue / /properties 添加缓存注释 这里使用的是休眠注释而不是标准注释实际上可缓存似乎不起作用 将缓存注释放置在域对象的类级别。 org.hibernate.annotations.Cache(usage org.hibernate.annotations.CacheConcurrencyStrategy.READ_WRITE) 例 懒惰的应用 Lazuly是一个示例数据库其中包含用于MinuteProject展示目的的会议信息。 Minuteproject生成了一组综合的伪像以加快OX应用程序的发布。 可以在Minuteproject 4 Openxava Lazuly展示柜中找到更多信息。 在这一部分我们重点介绍为特定于缓存生成的伪像。 用于生成的Minuteproject本身基于配置文件我们在其中定义数据模型以进行反向工程。 在此配置中有一个扩充部分您可以在其中添加信息。 处理实体类型中包含的内容类型的信息之一。 有4种可能性参考数据主数据伪静态数据实时业务数据 如果您使用content-type “ master-data”或“ reference-data”丰富您的实体MinuteProject 4 Openxava将生成关联的缓存。 这是针对国家实体在这里完成的。 entity nameCOUNTRY content-typereference-data 这是与缓存有关的伪像 ehcache.xml ehcache!--Sets the path to the directory where cache files are created.If the path is a Java System Property it is replaced by its value in therunning VM.The following properties are translated:* user.home - Users home directory* user.dir - Users current working directory* java.io.tmpdir - Default temp file pathSubdirectories can be specified below the property e.g. java.io.tmpdir/one-- !--MP-MANAGED-UPDATABLE-BEGINNING-DISABLE ehcache-main-config-conference--diskStore pathjava.io.tmpdir/!--Mandatory Default Cache configuration. These settings will be applied to cachescreated programmtically using CacheManager.add(String cacheName)--defaultCachemaxElementsInMemory1000eternalfalsetimeToIdleSeconds300timeToLiveSeconds300overflowToDiskfalsediskPersistentfalsediskExpiryThreadIntervalSeconds300memoryStoreEvictionPolicyLRU/ !-- The unnamed query cache --cachenameorg.hibernate.cache.StandardQueryCachemaxElementsInMemory1000eternalfalsetimeToLiveSeconds300overflowToDiskfalse/ !--MP-MANAGED-UPDATABLE-ENDING--!--MP-MANAGED-UPDATABLE-BEGINNING-DISABLE cache-entity-country-conference--cachenamenet.sf.mp.demo.conference.domain.admin.CountrymaxElementsInMemory5000eternalfalsetimeToIdleSeconds300timeToLiveSeconds600overflowToDiskfalse/ !--MP-MANAGED-UPDATABLE-ENDING--!--MP-MANAGED-ADDED-AREA-BEGINNING custom-cache-definition-- !--MP-MANAGED-ADDED-AREA-ENDING custom-cache-definition--/ehcache Persistence.xml persistence xmlnshttp://java.sun.com/xml/ns/persistencexmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsdversion1.0!-- Tomcat Hypersonic --persistence-unit namedefaultnon-jta-data-sourcejava:comp/env/jdbc/conferenceDS/non-jta-data-sourceclassorg.openxava.session.GalleryImage/classpropertiesproperty namehibernate.dialect valueorg.hibernate.dialect.MySQLDialect/property namehibernate.cache.provider_class valuenet.sf.ehcache.hibernate.SingletonEhCacheProvider /property namenet.sf.ehcache.configurationResourceName value/ehcache.xml /property namehibernate.cache.use_query_cache valuetrue /property namehibernate.cache.use_second_level_cache valuetrue /property namehibernate.generate_statistics valuetrue / !--MP-MANAGED-ADDED-AREA-BEGINNING properties-- !--MP-MANAGED-ADDED-AREA-ENDING properties--/properties !--MP-MANAGED-ADDED-AREA-BEGINNING persistence-unit-- !--MP-MANAGED-ADDED-AREA-ENDING persistence-unit--/persistence-unit !--MP-MANAGED-ADDED-AREA-BEGINNING persistence-- !--MP-MANAGED-ADDED-AREA-ENDING persistence--/persistence 类注解 org.hibernate.annotations.Cache(usage org.hibernate.annotations.CacheConcurrencyStrategy.READ_WRITE) //MP-MANAGED-ADDED-AREA-BEGINNING class-annotation //MP-MANAGED-ADDED-AREA-ENDING class-annotation public class Country {Hidden Id Column(nameid )GeneratedValue(strategy GenerationType.AUTO)private Integer id; ... 生成的代码备注 生成的代码在文件扩展名注释中包含标记。 在MP-MANAGED-ADDED-AREA-BEGINNING和MP-MANAGED-ADDED-AREA-ENDING中您可以放置​​自定义代码 在MP-MANAGED-UPDATABLE-BEGINNING-DISABLE和MP-MANAGED-UPDATABLE-ENDING中您可以更改代码。 要保留您的修改请将MP-MANAGED-UPDATABLE-BEGINNING-DISABLE更改为MP-MANAGED-UPDATABLE-BEGINNING-ENABLE。 可更新的代码可防止您连续几代丢失定制。 有关可更新代码的更多信息请参见Minuteproject可更新代码 。 代 将以下文件mp-config-LAZULY-OPENXAVA.xml放在/ mywork / config中 在提示符下执行mp-model-generation.sh / cmdmp-config-LAZULY-OPENXAVA.xml / DEV / output / openxava / conference中产生的人工制品 要生成请使用mp-config-LAZULY-OPENXAVA.xml的更新版本 !DOCTYPE root generator-configconfigurationconventionstarget-convention typeenable-updatable-code-feature //conventions model nameconference version1.0 package-rootnet.sf.mp.demodata-modeldriver namemysql version5.1.16 groupIdmysql artifactIdmysql-connector-java/driverdataSourcedriverClassNameorg.gjt.mm.mysql.Driver/driverClassNameurljdbc:mysql://127.0.0.1:3306/conference/urlusernameroot/usernamepasswordmysql/password/dataSource!--for Oracle and DB2 please set the schema schema /schema--primaryKeyPolicy oneGlobaltrueprimaryKeyPolicyPattern nameautoincrementPattern/primaryKeyPolicyPattern/primaryKeyPolicy/data-modelbusiness-model!--generation-condition condition typeexcludestartsWithDUAL/condition /generation-condition--business-package defaultconferencecondition typepackage startsWithSTAT resultstatistics/conditioncondition typepackage startsWithCOUNTRY resultadmin/conditioncondition typepackage startsWithROLE resultadmin/condition /business-packageenrichmentconventionscolumn-naming-convention typeapply-strip-column-name-suffixpattern-to-strip_ID /reference-naming-conventiontypeapply-referenced-alias-when-no-ambiguity is-to-plurializetrue //conventionsentity nameCOUNTRY content-typereference-datasemantic-referencesql-path pathNAME //semantic-reference/entityentity nameCONFERENCE_MEMBERsemantic-referencesql-path pathFIRST_NAME /sql-path pathLAST_NAME //semantic-referencefield nameSTATUSproperty tagcheckconstraint aliasconference_member_statusproperty namePENDING valuePENDING /property nameACTIVE valueACTIVE //property/fieldfield nameEMAILstereotype stereotypeEMAIL //field/entityentity nameSPEAKERfield nameBIOstereotype stereotypeHTML_TEXT //fieldfield namePHOTOstereotype stereotypePHOTO //fieldfield nameWEB_SITE_URLstereotype stereotypeWEBURL //field/entityentity namePRESENTATIONfield nameSTATUSproperty tagcheckconstraint aliaspresentation_statusproperty namePROPOSAL valuePROPOSAL /property nameACTIVE valueACTIVE //property/field/entityentity nameSPONSORfield nameSTATUSproperty tagcheckconstraint aliassponsor_statusproperty namePENDING valuePENDING /property nameACTIVE valueACTIVE //property/fieldfield namePRIVILEGE_TYPEproperty tagcheckconstraint aliassponsor_privilegeproperty nameGOLDEN valueGolden /property nameSILVER valueSilver /property nameBRONZE valueBronze //property/field/entity!-- views --entity namestat_mb_per_ctry_conf aliasMEMBER_PER_COUNTRY_AND_CONFERENCEvirtual-primary-key isRealPrimaryKeytrueproperty namevirtualPrimaryKey valueID //virtual-primary-key/entityentity namestat_mb_by_role aliasMEMBER_PER_ROLE_COUNTRY_AND_CONFERENCEvirtual-primary-key isRealPrimaryKeytrueproperty namevirtualPrimaryKey valueid //virtual-primary-keyfield namestat_mb_per_ctry_conf_ID linkToTargetEntitystat_mb_per_ctry_conflinkToTargetFieldid/field/entity/enrichment/business-model/modeltargets!-- openxava --target refnameOpenXava nameOpenXavafileNamemp-template-config-openxava-last-features.xmloutputdir-root../../DEV/output/openxava/conferencetemplatedir-root../../template/framework/openxava/targettarget refnameJPA2-LIB fileNamemp-template-config-JPA2-LIB.xmltemplatedir-root../../template/framework/jpa/targettarget refnameBSLA-LIB fileNamemp-template-config-bsla-LIB-features.xmltemplatedir-root../../template/framework/bsla/targettarget refnameCACHE-LIB fileNamemp-template-config-CACHE-LIB.xml templatedir-root../../template/framework/cache/target/targets/configuration /generator-config 测试 为确保缓存正常工作 启用休眠日志记录。 将以下代码段作为额外属性添加到persistence.xml中。 property namehibernate.show_sql valuetrue /property namehibernate.format_sql valuetrue / 导航到引用国家/地区的实体示例地址 当您查看此实体的详细信息时您会注意到相关实体“国家”的负载很大 但是第二次访问该实体或引用同一国家/地区实例的另一个实体的详细信息时该国家/地区不会从数据库中加载两次。 参考 JCG合作伙伴 将Ehcache添加到Openxava应用程序   分钟项目博客上的 Florian Adler。 翻译自: https://www.javacodegeeks.com/2012/03/adding-ehcache-to-openxava-application.html
http://www.yutouwan.com/news/309121/

相关文章:

  • 临安网站开发外贸页面网站制作
  • 免费下载app软件网站主持人做的化妆品网站
  • 网站怎么优化到首页如何注册自己的wordpress
  • 关于网站建设的调查问卷wordpress页面的模板
  • 偃师网站六安市网站制作
  • 做网站都需要哪些信息设计公司logo软件
  • 自己做企业网站好做吗有什么可以做翻译的网站
  • wordpress快速扒站thinkphp建站网址
  • 宝塔做的网站能不能访问长春新建设
  • 济南企业上云网站建设山东企业网站备案
  • 南宁在哪里推广网站郑州人流医院哪家好
  • 常平小学网站建设做淘宝客为什么要做网站
  • 中国最好的网站建设公司丹东抖音seo精英
  • 云科技网站建设自己做电影网站违法
  • 威海互联网公司苏州批量关键词优化
  • 网站首页设计图wordpress鏁版嵁
  • 网站开发与维护专业前景erp企业管理系统手机版
  • 网站建设要规避的新媒体代运营
  • 森网站建设粮油移动端网页设计素材
  • 陕西住房与城乡建设部网站wordpress手机浏览器
  • 网站的空间怎么查深圳网络营销外包公司推荐
  • 正规的网站制作联系方式百度大搜是什么
  • 做推广一般那些网站比较好什么网站可以帮人做ppt赚钱
  • 黑别人网站凡科小程序免费制作平台
  • 书店网站建设个人总结如何做电子书下载网站
  • 宛城区网站制作seo关键词排行优化教程
  • 北京专业网站外包公司国外高清视频素材网站推荐
  • 网站建设公司违法做网站一月工资
  • 网站免费网站的方法网页设计策划书
  • 福建省建设系统网站wordpress 域名 根目录