首页 \ 问答 \ “wordpress主题框架”与“空白主题”vs免费主题类似于我的设计?(“wordpress theme framework” vs “Blank themes” vs free theme similar to my design?)

“wordpress主题框架”与“空白主题”vs免费主题类似于我的设计?(“wordpress theme framework” vs “Blank themes” vs free theme similar to my design?)

我从客户那里得到了设计(PSD)。 我应该选择哪个自定义Wordpress主题。


I got the design (PSD) from client. Which should i choose to make custom Wordpress themes.


原文:https://stackoverflow.com/questions/2349960
更新时间:2022-05-06 22:05

最满意答案

正如我们在上面的评论中所讨论的,试试这个

public User updateUser(User user) {

    try {
        User result = session.get(User.class, user.getId());
        if (result == null) {
            throw new FilamentNoSuchRecordException(new CoreError(304, "User does not exist"));
        }
        result.setName(user.getName()); // update some properties
        session.update(result); // you should update 'result', not 'user'

        return result;
    } catch (HibernateException e) {
        e.printStackTrace();
        throw new FilamentDataConnectivityException(new CoreError(305,"Connectivity issue. Please see System Administrator"));
    }

}

As we discussed in above comments, try this -

public User updateUser(User user) {

    try {
        User result = session.get(User.class, user.getId());
        if (result == null) {
            throw new FilamentNoSuchRecordException(new CoreError(304, "User does not exist"));
        }
        result.setName(user.getName()); // update some properties
        session.update(result); // you should update 'result', not 'user'

        return result;
    } catch (HibernateException e) {
        e.printStackTrace();
        throw new FilamentDataConnectivityException(new CoreError(305,"Connectivity issue. Please see System Administrator"));
    }

}

相关问答

更多
  • 如此处所述 session.update() update将实体作为参数。但是您传递的是Map(我假设是您要保存的LocalSetting实体)。 据我所知,不可能使用update(..)方法持久保存对象集合。 请尝试以下代码来检查它是否适合您: @Override public void updateParameters(Map parameters) { for (Map.Entry
  • 你可以试试这个: DataaccessClass: public boolean update(YourClass yourObject) { Transaction transaction = null; boolean result = false; try { SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); Session session = sessionFa ...
  • 你已经拥有hibernate实体对象中的所有数据? 然后直接调用会话: getCurrentSession().save(myEntity); 创建一个新对象,或 getCurrentSession().update(myEntity); 更新现有行。 如果不确定,您可以使用: getCurrentSession().saveOrUpdate(myEntity); you already have all data present in the hibernate entity object? The ...
  • 这不是您问题的最终答案,但我希望它可以作为高级指南。 当您使用Spring创建实体时,该实体已分离,Hibernate执行这些SELECT语句,因为它需要在持久化之前附加您的实体。 另外,据我所知,任何附加实体的尝试都会触发SELECT语句。 因此,我坚信如果没有这些SELECT语句,没有任何方法可以保存/持久化您的分离实体(我可能在这里错了)。 如果您担心性能,可以尝试向应用程序添加一些缓存功能。 此外,您还可以将JDBC解决方案仅包含在性能受损的操作中。 This is not a final answ ...
  • 正如我们在上面的评论中所讨论的,试试这个 public User updateUser(User user) { try { User result = session.get(User.class, user.getId()); if (result == null) { throw new FilamentNoSuchRecordException(new CoreError(304, "User does not exist")); ...
  • 我建议你分开做。 对于第一次更新(所有字段,但通知 )我确实使用updatable = false告诉hibernate不要在SQL语句中包含该字段。 这样你只需要调用tha save()方法。 对于第二次更新(仅通知字段),请创建自定义查询: @Modifying @Query("UPDATE EventEntity e SET e.notified = ?2 WHERE e.id = ?1") @Transactional void customUpdate(UUID itemId, boolean n ...
  • 如果您在事务中,它实际上不会将更改提交给Student ,它只是将它们刷新到数据库。 在Query对象上调用executeUpdate时,它会在执行查询之前执行所有挂起更改的刷新,以确保数据一致性。 您的loadStudentById显然返回一个托管实体,由Hibernate跟踪。 它保留原始状态的副本,并将其与每次刷新时对象的当前状态进行比较。 如果您不希望跟踪其中的更改,可以调用session.detach(student) (如果使用Hibernate 5.2,它与EntityManager接口合并) ...
  • 给定如下所示的实体,您可以跟踪其中一个字段的更改(同时保留其原始值)。 @Entity @Table(schema = "test", name = "test") public final class Test { private static final int ORIGINAL = 0; private static final int CURRENT = 1; private Integer id; // holds the original and current state ...
  • 我在这里找到了问题的答案。 但只是稍作修改......这是我的代码: 首先,我从BaseModel类中删除了这两个方法: @PrePersist protected void onCreate() { createdAt = new Date(); } @PreUpdate protected void onUpdate() { updatedAt = new Date(); } 然后我创建了一个BaseTimestamps接口,用于设置我的createdAt和updatedAt变量 p ...
  • 其中一个选项是使用Hibernate的 dynamicInsert/dynamicUpdate功能。 你必须摆脱版本控制。 以下是Hibernate文档的摘录: dynamic-update(可选 - 默认为false):指定应在运行时生成UPDATE SQL,并且只能包含值已更改的列。 可以在此处找到此功能的示例。 One of the options is to use dynamicInsert/dynamicUpdate features of Hibernate. You would have t ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(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)