根据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_()是否可能?
我有使用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) \d当我在 中使用命令时psql,我得到所有用户的表和序列的列表。
是否有一个命令只显示特定用户是所有者的表?
一开始我想指出我不是,而且我从来都不是数据库管理员。我有相关的经验和知识PL/SQL,SQL但到目前为止,我接触的每个数据库最多有 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吗?
我创建了一个动态图像,该图像正在保存在Page_Load(object sender, EventArgs e)方法中.
我加载图像像:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<p>
</p>
<img alt="aa" class="style1" longdesc="aa"
src="file:///C:/project/Image/hours.png" />
</asp:Content>
Run Code Online (Sandbox Code Playgroud)
但只有正在展示的东西是:

我知道这是一个愚蠢的问题,但我不能让它发挥作用..任何人都可以指出我在哪里做错了吗?
我对动态二维数组的实现有问题.这就是我这样做的方式:
$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)
任何人都知道我做错了什么?