小编Grz*_*zzz的帖子

java Runnable run()方法返回一个值

根据java doc,Runnable方法void run()不能返回值.我不知道是否有任何解决方法.

其实我有一个调用的方法:

public class Endpoint{
    public method_(){
       RunnableClass runcls = new RunnableClass();
       runcls.run()
    }
}
Run Code Online (Sandbox Code Playgroud)

wheren方法run()是:

public class RunnableClass implements Runnable{

    public jaxbResponse response;
        public void run() {
            int id;
            id =inputProxy.input(chain);
            response = outputProxy.input();

        }
}
Run Code Online (Sandbox Code Playgroud)

我想要访问response变量method_()是否可能?

java runnable

42
推荐指数
4
解决办法
7万
查看次数

EntityManager persist()方法不会将记录插入数据库

我有使用EntityManager.persist(Object)方法的问题.现在当我摆脱其他问题时,通过app工作没有Exception但是对象没有放在我的数据库中.

我的实体类:

@Entity
@Table(name ="Chain")
public class Chain implements Serializable{

@Id
@Column(name = "id")
  private Long id;
@Column(name = "date")
  private Date date;
@Column(name = "name")
  private String name;
//setters and getters
}
Run Code Online (Sandbox Code Playgroud)

我的道教课:

@Transactional
@Repository("ChainDao")
public class ChainDaoImpl implements ChainDao{


    private EntityManager em;


    @PersistenceContext
    public void setEntityManager(EntityManager em) {
        this. em = em;
    }

    public int saveChain(Chain chain) {
        chain.setDate(new Date());
        chain.setId((long)44);
        Boolean a;
        em.persist(chain);

        return 222;
    }
}
Run Code Online (Sandbox Code Playgroud)

我的xml上下文:

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
    <property name="persistenceXmlLocation" value="classpath*:META-INF/persistence.xml"></property></bean> …
Run Code Online (Sandbox Code Playgroud)

spring hibernate jpa persist

10
推荐指数
2
解决办法
6万
查看次数

显示特定用户拥有的所有表的命令

\d当我在 中使用命令时psql,我得到所有用户的表和序列的列表。

是否有一个命令只显示特定用户是所有者的表?

postgresql psql

2
推荐指数
1
解决办法
3740
查看次数

PostgreSQL 命令显示实体关系

一开始我想指出我不是,而且我从来都不是数据库管理员。我有相关的经验和知识PL/SQLSQL但到目前为止,我接触的每个数据库最多有 50 个表,即使我手动创建,寻找实体之间的关系也不是那么难。

现在问题来了,当我有database超过 300 个表时,找到实体之间的关系并不是那么容易。
让想象表:

table person (
id serial PRIMARY KEY NOT NULL,
name varchar(45)
)
Run Code Online (Sandbox Code Playgroud)

并且自动我有序列:

person_id_seq
Run Code Online (Sandbox Code Playgroud)


你能告诉我是否有任何命令可以返回我正在使用的表person_id_seq吗?

postgresql psql

1
推荐指数
1
解决办法
9760
查看次数

图像未显示在ASP页面上

我创建了一个动态图像,该图像正在保存在Page_Load(object sender, EventArgs e)方法中.
我加载图像像:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <p>
       &nbsp;</p>
    <img alt="aa" class="style1" longdesc="aa"
        src="file:///C:/project/Image/hours.png" />
</asp:Content>
Run Code Online (Sandbox Code Playgroud)

但只有正在展示的东西是:
在此输入图像描述


我知道这是一个愚蠢的问题,但我不能让它发挥作用..任何人都可以指出我在哪里做错了吗?

c# asp.net image

0
推荐指数
1
解决办法
43
查看次数

PHP动态多维数组

我对动态二维数组的实现有问题.这就是我这样做的方式:

$array_ = array();
$values = array();

foreach ($queryresult as $row){
    array_push($value, $row['id'];
    array_push($value, $row['title'];
    array_push($array_, $value);
}  
var_dump(#array_);
Run Code Online (Sandbox Code Playgroud)

问题是我的查询返回3行,但我的结果如下: -

Array ([0] => Array ([0] => 44 [1] => Game of Thrones))
Run Code Online (Sandbox Code Playgroud)

任何人都知道我做错了什么?

php

0
推荐指数
1
解决办法
2万
查看次数

标签 统计

postgresql ×2

psql ×2

asp.net ×1

c# ×1

hibernate ×1

image ×1

java ×1

jpa ×1

persist ×1

php ×1

runnable ×1

spring ×1