首页 \ 问答 \ 如何在付款期结束后找到下周五(How to find the following Friday after a pay period ends)

如何在付款期结束后找到下周五(How to find the following Friday after a pay period ends)

我的公司每个星期五支付前一周的销售额。 我们的工作时间从星期日到星期六,我们将在每个星期五获得在该付款期内完成的任何工作。

我在J栏中列出了我的销售日期,我希望相应的发薪日出现在M栏中。所以如果J1有1/14/17,M1将返回1/20/17。 我发现的公式是:

=J1+7-WEEKDAY(J1+1)+7.

除了星期六的任何销售都没有支付13天,并且他们应该在6天内付款时,这几乎是完美的。 那么我该如何改变它以获得我需要的东西呢?


My company pays every Friday on the sales from the previous week. Our work period goes from Sunday to Saturday, and we get paid every following Friday for any work done in that pay period.

I have the dates of my sales in column J, and I want the corresponding payday to appear in column M. So if J1 had 1/14/17, M1 would return 1/20/17. The formula I found is:

=J1+7-WEEKDAY(J1+1)+7.

This works almost perfectly except that any sales made on a Saturday don't get paid out for 13 days, and they should get paid out in 6 days. So how do I change this to get what I need?


原文:https://stackoverflow.com/questions/41687267
更新时间:2023-11-19 22:11

最满意答案

在探索EclipseLink源代码后,我发现存储在持久化上下文(隔离缓存)中的对象位于名为identityMaps的映射中,每个实体类都有一个存储该类型所有对象的映射。

您可以使用以下方法打印地图的内容:

public interface IdentityMapAccessor {
    /**
     * PUBLIC:
     * Used to print all the Objects in the identity map of the given Class type.
     * The output of this method will be logged to this session's SessionLog at SEVERE level.
     */
    public void printIdentityMap(Class theClass);

    /**
     * PUBLIC:
     * Used to print all the Objects in every identity map in this session.
     * The output of this method will be logged to this session's SessionLog at SEVERE level.
     */
    public void printIdentityMaps();
}

例子:

((JpaEntityManager) entityManager.getDelegate())
            .getActiveSession()
            .getIdentityMapAccessor()
            .printIdentityMaps();
((JpaEntityManager) entityManager.getDelegate())
            .getActiveSession()
            .getIdentityMapAccessor()
            .printIdentityMap(MyClass.class);

After exploring the EclipseLink source code I found that the objects stored in the persistence context (isolated cache) are located in a maps called identityMaps for each entity class there is a map which stores all the objects of that type.

You can print the contents of the map using the following methods:

public interface IdentityMapAccessor {
    /**
     * PUBLIC:
     * Used to print all the Objects in the identity map of the given Class type.
     * The output of this method will be logged to this session's SessionLog at SEVERE level.
     */
    public void printIdentityMap(Class theClass);

    /**
     * PUBLIC:
     * Used to print all the Objects in every identity map in this session.
     * The output of this method will be logged to this session's SessionLog at SEVERE level.
     */
    public void printIdentityMaps();
}

Examples:

((JpaEntityManager) entityManager.getDelegate())
            .getActiveSession()
            .getIdentityMapAccessor()
            .printIdentityMaps();
((JpaEntityManager) entityManager.getDelegate())
            .getActiveSession()
            .getIdentityMapAccessor()
            .printIdentityMap(MyClass.class);

相关问答

更多
  • 如果您的程序是唯一使用数据库的应用程序,则不应禁用缓存,如果有多个客户端,则禁用缓存或重新配置缓存可能是正确的。 与任何缓存策略一样,权衡速度和陈旧数据之间的权衡。 大多数JPA实现在P执行 C ontexts之间共享(第二级)缓存(PC可以是第一级缓存),因此当您使用em.find()加载实体时,如果没有必要访问数据库,该实例已经缓存。 如果另一个客户端可以访问数据库,则在修改数据库时,最终可能会提供过时的数据。 如果您拥有集群JPA应用程序,并且数据库仅由JPA应用程序访问,则只要配置缓存协调,您仍可以 ...
  • NONE or, 是正确的机制。 或者对特定类使用@Cache批注。 我假设您的问题是您对两个查询使用相同的EntityManager。 EntityManager还需要维护它管理的所有实例的缓存。 始终刷新这些对象会导致应用程序所做的任何更改被丢弃。 (EntityManager是一个事务对象)。 ...
  • 在探索EclipseLink源代码后,我发现存储在持久化上下文(隔离缓存)中的对象位于名为identityMaps的映射中,每个实体类都有一个存储该类型所有对象的映射。 您可以使用以下方法打印地图的内容: public interface IdentityMapAccessor { /** * PUBLIC: * Used to print all the Objects in the identity map of the given Class type. * Th ...
  • 最后,在经历了六个月的头痛之后,我设法解决了这个问题。 一般错误是EclipseLink-2004 。 如果您检查Eclipselink错误参考: Eclipse链接错误参考页 ,它将显示“验证应用程序中的事务”。 我一直在使用应用程序管理的实体管理器。 为了控制交易是单线程,我使用了这个ManagerHelper类: EntityManagerHelper 问题在于我在Session属性中放置了一个托管对象。 我并不真正了解内部的流程,但是如果它被用于查询,它不知何故在主要事务之外创建了新的事务。 将对象 ...
  • EclipseLink在工厂级具有标识映射和缓存,允许设置缓存大小和允许垃圾收集的昂贵身份映射。 文档解释了它以及可用于根据您的应用程序需求控制或禁用它的选项 EclipseLink has both an identity map and cache at the factory level, allowing a set cache size and an expensive identity map that allows for garbage collection. The documentati ...
  • 在每个页面后使用分页 + entityManager.clear() 。 也可以在单个事务中执行每个页面,或者在发生异常后必须创建/获取新的EntityManager(至少使用Hibernate:EntityManager实例在异常后可能处于不一致状态)。 Use pagination + entityManager.clear() after each page. Also execute every page in a single transaction OR you will have to cre ...
  • 您正在使用的API为您提供了共享serverSession,您不应该使用它来查询,因为您已禁用共享缓存。 相反,您需要支持EntityManager的UnitOfWork,因为这将为此上下文维护缓存和对象。 entityManager.unwrap(UnitOfWork.class).executeQuery(readAllQuery); The API you are using is giving you the shared serverSession which you should not us ...
  • 存储在独立存储中的数据与更新后的数据完全相同,只要通过Marketplace完成更新即可。 如果应用程序被“侧载”或由Visual Studio / Expression Blend部署,那么它将卸载/重新安装不升级,因此您将丢失隔离存储中的内容。 如果您不在Visual Studio中执行全部重建,则它将单独保留隔离存储并有效执行升级。 Data stored in isolated storage remains exactly as it was after you update as long as ...
  • 您正在寻找的是EclipseLink中的存在检查,可以使用@ExistenceChecking注释进行配置,如下所述: http ://eclipse.org/eclipselink/documentation/2.4/jpa/extensions/a_existencechecking.htm 尝试指定@ExistenceChecking(ExistenceType.CHECK_CACHE),因为它声明check_cache是默认值,这适用于Native EclipseLink项目。 JPA项目使用Che ...
  • 根据数据模型的复杂性,使用JAXB应该是将对象编组(导出)到XML的相对简单的方法。 您必须使用@XmlRootElement或@XmlType注释您的实体,并使用@XmlElement或@XmlAttribute注释您的字段。 Depending on the complexity of your data model, using JAXB should be a relatively easy way to marshal (export) your objects to XML. You will ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)