映射相同的类关系 - 延续 [英] Mapping same class relation - continuation

查看:143
本文介绍了映射相同的类关系 - 延续的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这篇文章是这篇文章的延续



我有DlUser Class此类的每个对象都可能有DLFaceBook类,而DlFaceBook的每个对象都可以有映射为myFriends的朋友。

我试图使用包映射,复合主键和静态内部类将多个关系映射到多个关系。我的代码如下:

  public class DlUser {
public DlUser(){}
Long Id ;
字符串名字;
字符串姓氏;
....
DlFaceBook fbuser;
////全部请求
获取者和设置者...
}

Facebook用户类看起来像这样,你可以看到我拥有MyFriends类的对象集合:

  public class DlFaceBook {
private long dlpId;
private String FbId;
私人收藏< MyFriends>朋友;
public DlFaceBook(){}
public void setFbId(String FbId)
{
this.FbId = FbId;
}
public void setFriends(Collection< MyFriends> friends)
{
this.Friends = friends;
}
public Collection< MyFriends> getFriends()
{
返回this.Friends;
}
public void setdlpId(long id)
{
this.dlpId = id;
}
public long getdlpId()
{
return this.dlpId;
}
public String getFbId()
{
return this.FbId;


MyFriends类看起来像这样:

  public class MyFriends {

private MyFriendsId myFriendId;

私人DlFaceBook我;
私人DlFaceBook myFriend;
public MyFriendsId getmyFriendId(){
return this.myFriendId;
}
public void setmyFriendId(MyFriendsId fid){
this.myFriendId = fid;
}

public void setme(DlFaceBook me){
this.me = me;
}
public void setmyFriend(DlFaceBook friend){
this.myFriend = friend;
}
public DlFaceBook getme(){
return this.me;
}
public DlFaceBook getmyFriend(){
return this.myFriend;
}
public MyFriends(DlFaceBook me,DlFaceBook用户){
this.me = me;
this.myFriend = user;
this.myFriendId = new MyFriendsId(me.getdlpId(),user.getdlpId());
}
public static class MyFriendsId implements Serializable {

private long meId;
私人长myFrId;

// getter's和setter's
$ b $ public MyFriendsId(){} $ b $ public MyFriendsId(long meId,long myFriendId){
this.meId = meId ;
this.myFrId = myFriendId;


// getter's和setter's
public long getmeId(){
return this.meId;
}
public void setmeId(Integer id){
this.meId = id;
}

public long getmyFrId(){
return this.myFrId;
}
public void setmyFrId(long id){
this.myFrId = id;
}
}
}

现在映射: p>

DlUser.hbm.xml如下,它很简单:

 < ;冬眠映射> 
< class name =DlUsertable =Users>
< id name =Idcolumn =id>
< generator class =sequence>
< param name =sequence> userseq< / param>
< / generator>
< / id>
< property name =firstName>
< column name =FirstName/>
< / property>
< property name =lastName>
< column name =LastName/>
< / property>
<多对一
名称=FaceBook
class =DlFaceBook
cascade =全部
列=dlpId
unique =true
/>
< / class>
< / hibernate-mapping>

DlFacebook.hbm.xml如下所示:

 <休眠映射> 
< class name =DlFaceBooktable =dlfacebook>
< id name =dlpIdtype =java.lang.Longcolumn =dlpId>
< generator class =increment/>
< / id>
< property name =fbId>
< column name =fbId/>
< / property>
< bag name =好友>
< key column =me_Id/>
<一对多课程=MyFriends/>
< / bag>
< / class>
< / hibernate-mapping>

然后MyFriends.hbm.xml如下所示:

 < hibernate-mapping> 
< class name =MyFriends>
< composite-id name =myFriendIdclass =MyFriends $ MyFriendsId>
< key-property name =meId/>
< key-property name =myFrId/>
< / composite-id>
< / class>
< / hibernate-mapping>

当我执行我的查询时,出现以下错误:

  Hibernate:插入到dlfacebook(fbId,dlpId)值(?,?)
Hibernate:插入用户(名字,姓氏,email,twitter,生日,dlpId,id)值(?,?,?,?,?,?,?)
Hibernate:更新MyFriends set me_Id =? meId =?和myFrId =?
Hibernate:更新MyFriends set me_Id =? meId =?和myFrId =?
2010年10月2日下午1时21分18秒org.hibernate.jdbc.BatchingBatcher doExecuteBatch
SEVERE:执行批处理的异常:
org.hibernate.StaleStateException:批处理更新从更新返回意外的行计数[0];实际行数:0;预期:1
at org.hibernate.jdbc.Expectations $ BasicExpectation.checkBatched(Expectations.java:85)
at org.hibernate.jdbc.Expectations $ BasicExpectation.verifyOutcome(Expectations.java:70)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate。 jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
在org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
在org.hibernate.engine.ActionQueue.executeActions(ActionQueue。
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at Test.main(Test.java:54)
Oct 2,2010 1:21:18 PM org.hi bernate.event.def.AbstractFlushingEventListener performExecutions
SEVERE:无法使数据库状态与会话
同步org.hibernate.StaleStateException:批更新返回来自update [0]的意外行计数;实际行数:0;预期:1
at org.hibernate.jdbc.Expectations $ BasicExpectation.checkBatched(Expectations.java:85)
at org.hibernate.jdbc.Expectations $ BasicExpectation.verifyOutcome(Expectations.java:70)
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate。 jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
在org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
在org.hibernate.engine.ActionQueue.executeActions(ActionQueue。
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at Test.main(Test.java:54)
批量更新返回unexpec来自update [0]的行计数;实际行数:0;预计:1

我发现当我们尝试更新不存在的行时会发生此错误,但是如何才能我做这个代码工作?

解决方案

只是Facebook和MyFriends

Facebook 注意添加便利方法和MutableLong(稍后,我告诉你为什么要使用MutableLong)

  public class Facebook {

private MutableLong id = new MutableLong();
public Long getId(){return id.longValue(); }
public void setId(Long id){this.id.setValue(id); }
$ b $ public MutableLong getIdAsMutableLong(){
return id;
}

私人收藏< MyFriends> myFriends = new ArrayList< MyFriends>();
public Collection< MyFriends> getMyFriends(){return myFriends; }
public void setMyFriends(Collection< MyFriends> myFriends){this.myFriends = myFriends; }
$ b / **
*添加便利方法
* /
public void addFriend(Facebook myFriendFacebook){
myFriends.add(new MyFriends(this ,myFriendFacebook));
}

}

MyFriends

  public class MyFriends {

private MyFriendsId myFriendId;
public MyFriendsId getmyFriendId(){return this.myFriendId; }
public void setmyFriendId(MyFriendsId myFriendId){this.myFriendId = myFriendId; }

私人Facebook我;
public Facebook getme(){return this.me; }
public void setme(Facebook me){this.me = me; }

私人Facebook myFriend;
public Facebook getmyFriend(){return this.myFriend; }
public void setmyFriend(Facebook friend){this.myFriend = friend; }
$ b $ public MyFriends(){}
public MyFriends(Facebook meFacebook,Facebook myFriendFacebook){
this.me = meFacebook;
this.myFriend = myFriendFacebook;

this.myFriendId = new MyFriendsId(meFacebook.getIdAsMutableLong(),myFriendFacebook.getIdAsMutableLong());


public static class MyFriendsId implements Serializable {

private MutableLong meId = new MutableLong();
public Long getMeId(){return this.meId.longValue(); }
public void setMeId(Long id){this.meId.setValue(id); }

private MutableLong myFriendId = new MutableLong();
public Long getMyFriendId(){return this.myFriendId.longValue(); }
public void setMyFriendId(Long id){this.myFriendId.setValue(id); }
$ b $ public MyFriendsId(){} $ b $ public MyFriendsId(MutableLong meId,MutableLong myFriendId){
this.meId = meId;
this.myFriendId = myFriendId;

$ b @Override
public boolean equals(Object o){
if(!(o instanceof MyFriendsId))
return false;

MyFriendsId other =(MyFriendsId)o;
返回新的EqualsBuilder()
.append(getMeId(),other.getMeId())
.append(getMyFriendId(),getMyFriendId())
.isEquals();

$ b @Override
public int hashCode(){
return new HashCodeBuilder()
.append(getMeId())
。 append(getMyFriendId())
.hashCode();
}

}
}

映射

 < hibernate-mapping package =br.com._3845772.model.domain> 
< class name =User>
< id name =id>
< generator class =native/>
< / id>
< / class>
< class name =Facebook>
< id name =id>
< generator class =native/>
< / id>
< bag cascade =allname =myFriends>
< key column =ME_FACEBOOK_IDupdate =false/>
<一对多课程=MyFriends/>
< / bag>
< / class>
< class name =MyFriends>
< composite-id class =MyFriends $ MyFriendsIdname =myFriendId>
< key-property column =ME_FACEBOOK_IDname =meId/>
< key-property column =MY_FRIEND_FACEBOOK_IDname =myFriendId/>
< / composite-id>
< / class>
< / hibernate-mapping>

此示例

  Facebook meFacebook = new Facebook(); 
Facebook myFriendFacebook =新Facebook();

meFacebook.addFriend(myFriendFacebook);

会话会话= sessionFactory.openSession();
session.beginTransaction();

session.save(myFriendFacebook);
session.save(meFacebook);

session.getTransaction()。commit();
session.close();

哪给了我

 Hibernate:插入Facebook值()
Hibernate:插入Facebook值()
Hibernate:从MyFriends myfriends_中选择myfriends_.ME_FACEBOOK_ID,myfriends_.MY_FRIEND_FACEBOOK_ID,其中myfriends_.ME_FACEBOOK_ID =?和myfriends_.MY_FRIEND_FACEBOOK_ID =?
Hibernate:插入MyFriends(ME_FACEBOOK_ID,MY_FRIEND_FACEBOOK_ID)值(?,?)

A一对笔记


  • Hibernate 不支持自动生成组合主键。 必须在保存之前设置其值

  • 您的数据库必须支持目标生成器策略(如果您不知道哪种生成器策略您的数据库支持,更喜欢使用本地策略)

  • 每个实体必须提供一个无参数构造函数



  • $ b

    现在为什么使用MutableLong(Long属性封装)而不是Long?



    Number及其子类(Long是一个数字)是不可变的。因此,如果您希望Facebook.id(由数据库配置)及其对应的MyFriend $ MyFriendId.meId 共享相同的值,则必须使用MutableLong 。当数据库设置Facebook.id时,MyFriend $ MyFriendId.meId将自动获得其最新值。但是,如果您使用MutableLong,则会发生。


    This post is an continuation of this post

    I have DlUser Class each object of this class may have DLFaceBook class and each object of DlFaceBook can have Friends which are mapped as myFriends.

    I'm trying to map relation of the same class as many to many relation using bag mapping,composite primary key and static inner class. my code is the following:

    public class DlUser{
     public DlUser(){}
     Long Id;
     String FirstName;
     String LastName;
     ....
     DlFaceBook fbuser;
     //// all requred 
     getters and setters...
    }
    

    The Facebook user class looks like this as you can see I have the collection of objectes with the class MyFriends:

    public class DlFaceBook {
    private long dlpId;
    private String FbId;
    private Collection<MyFriends> Friends;
    public DlFaceBook(){}
    public void setFbId(String FbId)
    {
        this.FbId = FbId;
    }
    public void setFriends(Collection<MyFriends> friends)
    {
        this.Friends = friends;
    }
    public Collection<MyFriends> getFriends()
    {
        return this.Friends;
    }
    public void setdlpId(long id)
    {
        this.dlpId = id;
    }
    public long getdlpId()
    {
        return this.dlpId;
    }
    public String getFbId()
    {
        return this.FbId;
    }
    }
    

    MyFriends class looks like this:

    public class MyFriends {
    
        private MyFriendsId myFriendId;
    
        private DlFaceBook me;
        private DlFaceBook myFriend;
       public MyFriendsId getmyFriendId(){
            return this.myFriendId;
       }
       public void setmyFriendId(MyFriendsId fid){
        this.myFriendId = fid;
       }
    
        public void setme(DlFaceBook me){
          this.me = me;
       }
       public void setmyFriend(DlFaceBook friend){
              this.myFriend = friend;
           }
       public DlFaceBook getme(){
              return this.me ;
           }
           public DlFaceBook getmyFriend(){
                  return this.myFriend ;
               }
        public MyFriends(DlFaceBook me, DlFaceBook user){
            this.me = me ;
            this.myFriend = user;
            this.myFriendId = new MyFriendsId(me.getdlpId(),user.getdlpId());
        }
        public static class MyFriendsId implements Serializable {
    
            private long meId;
            private long myFrId;
    
            // getter's and setter's
    
            public MyFriendsId() {}
            public MyFriendsId(long meId, long myFriendId) {
                this.meId = meId;
                this.myFrId = myFriendId;
            }
    
            // getter's and setter's
            public long getmeId(){
                return this.meId;
            }
            public void setmeId(Integer id){
                this.meId = id;
            }
    
            public long getmyFrId(){
                return this.myFrId;
            }
            public void setmyFrId(long id){
                this.myFrId = id;
            }
        }
    } 
    

    Now the Mapping:

    DlUser.hbm.xml is the following and it's simple:

    <hibernate-mapping>
      <class name="DlUser" table="Users">
      <id name="Id" column="id" >
    <generator class="sequence">
                    <param name="sequence">userseq</param>
                </generator>        
     </id>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
     <property name="firstName">
         <column name="FirstName" />
      </property>
      <property name="lastName">
        <column name="LastName"/>
      </property>
     <many-to-one
                name="FaceBook"
                class="DlFaceBook"
                cascade="all"
                column="dlpId"
                unique="true" 
            />
     </class>
    </hibernate-mapping>
    

    DlFacebook.hbm.xml looks like this:

    <hibernate-mapping>
      <class name="DlFaceBook" table="dlfacebook">
     <id name="dlpId" type="java.lang.Long" column="dlpId">
    <generator class="increment" />
    </id>
       <property name="fbId">
         <column name="fbId" />
      </property>
         <bag name="Friends"> 
                <key column="me_Id" />
                <one-to-many class="MyFriends"/>
            </bag>
     </class>
    </hibernate-mapping>
    

    Then MyFriends.hbm.xml looks like this:

    <hibernate-mapping>
      <class name="MyFriends">
      <composite-id name="myFriendId" class="MyFriends$MyFriendsId">
            <key-property name="meId"/>
            <key-property name="myFrId"/>
        </composite-id>
        <many-to-one name="me" class="DlFaceBook" insert="false" update="false"/>
        <many-to-one name="myFriend" class="DlFaceBook" insert="false" update="false"/>
        </class>
        </hibernate-mapping>
    

    When I'm executing my query I got the following error:

    Hibernate: insert into dlfacebook (fbId, dlpId) values (?, ?)
    Hibernate: insert into Users (FirstName, LastName, email, twitter, birthday, dlpId, id) values (?, ?, ?, ?, ?, ?, ?)
    Hibernate: update MyFriends set me_Id=? where meId=? and myFrId=?
    Hibernate: update MyFriends set me_Id=? where meId=? and myFrId=?
    Oct 2, 2010 1:21:18 PM org.hibernate.jdbc.BatchingBatcher doExecuteBatch
    SEVERE: Exception executing batch: 
    org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
        at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85)
        at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)
        at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90)
        at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:183)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
        at Test.main(Test.java:54)
    Oct 2, 2010 1:21:18 PM org.hibernate.event.def.AbstractFlushingEventListener performExecutions
    SEVERE: Could not synchronize database state with session
    org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
        at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85)
        at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)
        at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:90)
        at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:183)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
        at Test.main(Test.java:54)
    Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
    

    I see that this error happens when we trying to update not existing row, but how can I make this code work?

    解决方案

    Just Facebook and MyFriends

    Facebook Notice add convenience method and MutableLong (later, i tell you why to use MutableLong)

    public class Facebook {
    
        private MutableLong id = new MutableLong();
        public Long getId() { return id.longValue(); }
        public void setId(Long id) { this.id.setValue(id); }
    
        public MutableLong getIdAsMutableLong() {
            return id;
        }
    
        private Collection<MyFriends> myFriends = new ArrayList<MyFriends>();
        public Collection<MyFriends> getMyFriends() { return myFriends; }
        public void setMyFriends(Collection<MyFriends> myFriends) { this.myFriends = myFriends; }
    
        /**
         * add convenience method
         */
        public void addFriend(Facebook myFriendFacebook) {
            myFriends.add(new MyFriends(this, myFriendFacebook));
        }
    
    }
    

    MyFriends

    public class MyFriends {
    
        private MyFriendsId myFriendId;
        public MyFriendsId getmyFriendId(){ return this.myFriendId; }
        public void setmyFriendId(MyFriendsId myFriendId){ this.myFriendId = myFriendId; }
    
        private Facebook me;
        public Facebook getme() { return this.me; }
        public void setme(Facebook me){ this.me = me; }
    
        private Facebook myFriend;
        public Facebook getmyFriend() { return this.myFriend; }
        public void setmyFriend(Facebook friend) { this.myFriend = friend; }
    
        public MyFriends() {}
        public MyFriends(Facebook meFacebook, Facebook myFriendFacebook){
            this.me = meFacebook ;
            this.myFriend = myFriendFacebook;
    
            this.myFriendId = new MyFriendsId(meFacebook.getIdAsMutableLong(), myFriendFacebook.getIdAsMutableLong());
        }
    
        public static class MyFriendsId implements Serializable {
    
            private MutableLong meId = new MutableLong();
            public Long getMeId() { return this.meId.longValue(); }
            public void setMeId(Long id) { this.meId.setValue(id); }
    
            private MutableLong myFriendId = new MutableLong();
            public Long getMyFriendId(){ return this.myFriendId.longValue(); }
            public void setMyFriendId(Long id) { this.myFriendId.setValue(id); }
    
            public MyFriendsId() {}
            public MyFriendsId(MutableLong meId, MutableLong myFriendId) {
                this.meId = meId;
                this.myFriendId = myFriendId;
            }
    
            @Override
            public boolean equals(Object o) {
                if (!(o instanceof MyFriendsId))
                    return false;
    
                MyFriendsId other = (MyFriendsId) o;
                return new EqualsBuilder()
                           .append(getMeId(), other.getMeId())
                           .append(getMyFriendId(), getMyFriendId())
                           .isEquals();
            }
    
            @Override
            public int hashCode() {
                return new HashCodeBuilder()
                           .append(getMeId())
                           .append(getMyFriendId())
                           .hashCode();
            }
    
        }
    }
    

    Mapping

    <hibernate-mapping package="br.com._3845772.model.domain">
        <class name="User">
            <id name="id">
                <generator class="native"/>
            </id>
            <many-to-one cascade="all" class="Facebook" name="facebook"/>
        </class>
        <class name="Facebook">
            <id name="id">
                <generator class="native"/>
            </id>
            <bag cascade="all" name="myFriends">
                <key column="ME_FACEBOOK_ID" update="false"/>
                <one-to-many class="MyFriends"/>
            </bag>
        </class>
        <class name="MyFriends">
            <composite-id class="MyFriends$MyFriendsId" name="myFriendId">
                <key-property column="ME_FACEBOOK_ID" name="meId"/>
                <key-property column="MY_FRIEND_FACEBOOK_ID" name="myFriendId"/>
            </composite-id>
            <many-to-one class="Facebook" column="ME_FACEBOOK_ID" insert="false" name="me" update="false"/>
            <many-to-one class="Facebook" column="MY_FRIEND_FACEBOOK_ID" insert="false" name="myFriend" update="false"/>
        </class>
    </hibernate-mapping>
    

    And this sample

    Facebook meFacebook = new Facebook();
    Facebook myFriendFacebook = new Facebook();
    
    meFacebook.addFriend(myFriendFacebook);
    
    Session session = sessionFactory.openSession();
    session.beginTransaction();
    
    session.save(myFriendFacebook);
    session.save(meFacebook);
    
    session.getTransaction().commit();
    session.close();
    

    Which gives me

    Hibernate: insert into Facebook values ( )
    Hibernate: insert into Facebook values ( )
    Hibernate: select myfriends_.ME_FACEBOOK_ID, myfriends_.MY_FRIEND_FACEBOOK_ID from MyFriends myfriends_ where myfriends_.ME_FACEBOOK_ID=? and myfriends_.MY_FRIEND_FACEBOOK_ID=?
    Hibernate: insert into MyFriends (ME_FACEBOOK_ID, MY_FRIEND_FACEBOOK_ID) values (?, ?)
    

    A couple of notes

    • Hibernate does not support automatic generation of composite primary key. You must set up its value before saving
    • Your database must support the target generator strategy (If you does not know which generator strategy your database support, prefer to use a native strategy)
    • Each entity must supply a no-arg constructor

    Now why MutableLong (encapsulated by a Long property) instead of Long ?

    Number and its subclasses (Long is a Number) are immutable. So if you want Facebook.id (configured by database) and its counterpart MyFriend$MyFriendId.meId share the same value, you must use MutableLong. When the database set up Facebook.id, MyFriend$MyFriendId.meId automatically get its newest value. But it just occurs if you use a MutableLong.

    这篇关于映射相同的类关系 - 延续的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆